- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
Working with Models, Views, Controllers, and Routes in Visual C#
Working with Models, Views, Controllers, and Routes Data Matrix ECC200 Decoder In C# Using Barcode recognizer for VS .NET Control to read, scan Data Matrix 2d barcode image in .NET applications. www.OnBarcode.comDecode ECC200 In Visual C# Using Barcode recognizer for .NET Control to read, scan read, scan image in VS .NET applications. www.OnBarcode.comFigure 2-2 Decode Barcode In Visual C#.NET Using Barcode recognizer for .NET Control to read, scan barcode image in Visual Studio .NET applications. www.OnBarcode.comRecognize Bar Code In C#.NET Using Barcode reader for .NET framework Control to read, scan read, scan image in VS .NET applications. www.OnBarcode.comThe default application index page
ECC200 Recognizer In C#.NET Using Barcode decoder for VS .NET Control to read, scan Data Matrix image in .NET framework applications. www.OnBarcode.comDataMatrix Recognizer In Visual Studio .NET Using Barcode recognizer for ASP.NET Control to read, scan Data Matrix 2d barcode image in ASP.NET applications. www.OnBarcode.comthis view is named after the controller and action and can be found in the corresponding view scripts directory, which in this case would be $APP_DIR/application/views/scripts/index/index phtml Open this file and you ll see the HTML markup that generates the output shown in Figure 2-2: Data Matrix Reader In VS .NET Using Barcode recognizer for .NET framework Control to read, scan Data Matrix image in VS .NET applications. www.OnBarcode.comDataMatrix Scanner In VB.NET Using Barcode decoder for VS .NET Control to read, scan Data Matrix 2d barcode image in .NET framework applications. www.OnBarcode.com<style> a:link, a:visited { color: #0398CA; } span#zf-name { color: #91BE3F; } div#welcome { color: #FFFFFF; background-image: url( http://frameworkzendcom/images/bkg_headerjpg); width: 600px; height: 400px; border: 2px solid #444444; overflow: hidden; text-align: center; } Denso QR Bar Code Reader In Visual C# Using Barcode decoder for .NET framework Control to read, scan QR image in .NET framework applications. www.OnBarcode.comScanning EAN 13 In Visual C#.NET Using Barcode recognizer for VS .NET Control to read, scan EAN13 image in VS .NET applications. www.OnBarcode.comZend Framework: A Beginner s Guide
Decode PDF-417 2d Barcode In C# Using Barcode scanner for Visual Studio .NET Control to read, scan PDF-417 2d barcode image in Visual Studio .NET applications. www.OnBarcode.comReading UPC-A Supplement 2 In C# Using Barcode recognizer for .NET framework Control to read, scan UPC-A Supplement 5 image in VS .NET applications. www.OnBarcode.comdiv#more-information { background-image: url( http://frameworkzendcom/images/bkg_body-bottomgif); height: 100%; } </style> <div id="welcome"> <h1>Welcome to the <span id="zf-name">Zend Framework!</span></h1> <h3>This is your project's main page</h3> <div id="more-information"> <p><img src= "http://frameworkzendcom/images/PoweredBy_ZF_4LightBGpng" /> </p> <p> Helpful Links: <br /> <a href="http://frameworkzendcom/">Zend Framework Website</a> | <a href="http://frameworkzendcom/manual/en/"> Zend Framework Manual</a> </p> </div> </div> Recognizing International Standard Book Number In Visual C#.NET Using Barcode reader for VS .NET Control to read, scan ISBN - 13 image in VS .NET applications. www.OnBarcode.comBar Code Scanner In .NET Framework Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications. www.OnBarcode.comFrom this markup, it should be clear that so long as you name and place your controllers, actions, and views correctly, there isn t really very much work for you to do The framework will automatically locate and execute files for you, using its default routes, without requiring any manual intervention As you proceed through this chapter and the remainder of this book, you ll learn a little more about how these standard Zend Framework conventions can be used to your advantage, by reducing the amount of manual coding required in getting an application up and running Decoding European Article Number 13 In Java Using Barcode reader for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comPDF-417 2d Barcode Decoder In Java Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications. www.OnBarcode.comUnderstanding the Modular Directory Layout
Decode Data Matrix ECC200 In Visual Studio .NET Using Barcode scanner for VS .NET Control to read, scan Data Matrix 2d barcode image in VS .NET applications. www.OnBarcode.comRead Code-39 In None Using Barcode decoder for Excel Control to read, scan Code 3 of 9 image in Office Excel applications. www.OnBarcode.comIn the previous chapter, you saw how the zf command-line tool creates a directory structure for your new Zend Framework application In its initial form, this structure only contains the directories needed to get a basic test application up and running As you flesh out your application with new features, you ll also need to expand this basic structure and create additional directories to hold different types of data To better understand this, consider Figure 2-3, which illustrates the full directory structure for a Zend Framework application Each of the directories shown in Figure 2-3 has a specific purpose, as listed in Table 2-1 The $APP_DIR/application/modules/ directory bears special mention This directory Read ANSI/AIM Code 128 In None Using Barcode reader for Excel Control to read, scan Code 128 Code Set C image in Office Excel applications. www.OnBarcode.comData Matrix 2d Barcode Recognizer In Java Using Barcode scanner for Java Control to read, scan DataMatrix image in Java applications. www.OnBarcode.com 2: Working with Models, Views, Controllers, and Routes
Directory
$APP_DIR/application $APP_DIR/application/controllers $APP_DIR/application/views $APP_DIR/application/models $APP_DIR/application/configs $APP_DIR/application/layouts $APP_DIR/application/modules $APP_DIR/library $APP_DIR/public $APP_DIR/public/css $APP_DIR/public/js $APP_DIR/public/images $APP_DIR/tests $APP_DIR/temp Table 2-1 Description
Main application directory Global controllers Global views Global models Global configuration data Global layouts Modules Third-party libraries and classes Main publicly accessible directory CSS style sheets JavaScript program code Application images Unit tests Temporary data The Key Directories in a Zend Framework Application
is intended to store application modules, with each module represented as a subdirectory under $APP_DIR/application/modules/ The internal structure of each module directory mirrors that of the global $APP_DIR/application/ directory, as shown in Figure 2-4 This directory structure thus makes a distinction between global application controllers, views, and models, which are stored under the $APP_DIR/application/ hierarchy, and modulespecific controllers, views, and models, which are stored under the $APP_DIR/application/modules/ hierarchy From a development perspective, the choice of which location to use for your application s code is an entirely subjective one There is no one correct approach, and so you can choose to store your code in the global directories, in permodule directories, or in a hybrid combination of both, depending on what approach you find Figure 2-3 The recommended directory structure for a Zend Framework application
Zend Framework: A Beginner s Guide
appropriate to your application s requirements and structure That said, the SQUARE example application described in these chapters makes extensive use of modules, and this book recommends the use of modules in general for Zend Framework application development, for the following reasons: Organizing code into modules produces a structured code tree, because all the controllers, views, and models related to a particular function or set of functions are stored within the same directory tree A module-based directory layout also makes the areas of logical separation within an application immediately visible, with no additional documentation necessary, and is more maintainable in the long run Figure 2-4 Organizing code into modules encourages the creation of more robust and extensible software Modules can be structured as independent packages with their own controllers, views, and models Modules can thus be thought of as reusable components that can be plugged in to an existing application to quickly give it new functionality
|
|