Bootstrapping the Application: the Standard Front Controller Resource Plugin
Thursday, September 24, 2009

The Zend Framework uses the front controller pattern. This involves all requests being channeled via a single object. To make use of the front controller you need to create an instance of Zend_Controller_Front and run it. Zend_Application automates this process.

The standard resource plugin for setting up the front controller is Zend_Application_Resource_Frontcontroller. Adding a reference to it in the configuration file ensures that the front controller will be initialised and run:

resources.frontController.controllerDirectory =
  APPLICATION_PATH "/controllers"

In addition, this line sets the location of the controllers directory, where the files implementing the various controllers will be placed. Note that the constant APPLICATION_PATH is dynamically generated in the index.php file.

Posted by James at 8:35 pm   0 comments

Leave a Reply