What does it give me to register plugins to the fron controller?
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:
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().
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.