Zend Framework Intro: Creating ControllerTag: framework, zend, zend framework, controller, MVC Category: PHP Frameworkpost: 09 Apr 2008 read: 2,217 Zend Framework Step By Step Tutorial - Part 5: The front controller pattern maps the URL requested by the user to a particular member function within a specific controller class. We called as routing and dispatching. The controller class have a strict naming convention requirement. The router calls a function named {actionname}Action() within the {ControllerName}Controller class. This class must be within a file called {ControllerName}.php. If not provide, index will be used. Still confuse? look at this example: Create a file named "IndexController.php" within application/controllers. Enter following code:
Within the front controller system, the dispatcher expects to find a file called IndexController.php within the application/controllers directory. This file must contain a class called Indexcontroller and, as a minimum, contain a function called indexAction(). |
| | Give Your Opinion | Recommend |
|

