I am aware of this site not working properly. I am working on it!
Zend Framework
v0.4.6.0 beta

I have seen in many cases/applications (including PHPancake) that it is common practice to register a plugin with the front controller.


Front controller has several stages until he serves the HTML to the client:

  1. routeStartup(): prior to routing the request
  2. routeShutdown(): after routing the request
  3. dispatchLoopStartup(): prior to entering the dispatch loop
  4. preDispatch(): prior to dispatching an individual action
  5. postDispatch(): after dispatching an individual action
  6. dispatchLoopShutdown(): after completing the dispatch loop

You might want to add some actions/logic to each of those events, so instead of you starting to enter the core code of ZF, ZF developers gave you a way to hook code to those events, The plug-ins. Basically, a plug-in is a class the front controller saves in him (via the register method). Each time an event happens (like routeShutdown) the Front Controller loops on all of it's plug-ins and call each of the plug-ins the method routeShutdown().
The same happens with the rest of events.
To get the technicalities, I would suggest you read from Zend's devzone.


Zend Framework features a set of MVC components that allow you to rapidly develop a web application by dividing functionality into separate controllers. Controllers can be grouped in modules, but we won't discuss about that in this tutorial.

A principal actor of the MVC pattern is the Front Controller, which interprets the HTTP request. Depending on the Get and Post parameters, it instances a specific controller. Afterwards, it calls one of its methods (called an action). This operation is called "dispatching". In a dispatch, the (module, controller, action) tuple determines which specific piece of code is going to be executed for the current request.

Additional front controller functionality can be added using the plugin system. One of the default plugins coming with Zend Framework is the ErrorHandler (ZendControllerPlugin_ErrorHandler class). If an exception was thrown by the current dispatch, this plugin will take care of displaying an error page.

In this tutorial, the security implications of the thrownExceptions setting will be considered.

Visit anthony's tuition class. Specialist in <a href="http://www.anthonytuition.com/">H2 Physics Tuition and <a href="http://www.anthonytuition.com/">H2 Maths Tuition.