The controller architecture includes a plugin system that allows user code to be called when certain events occur in the controller process lifetime. The front controller uses a plugin broker as a registry for user plugins, and the plugin broker ensures that event methods are called on each plugin registered with the front controller.
The event methods are defined in the abstract class
Zend_Controller_Plugin_Abstract, from which user plugin
classes inherit:
routeStartup()is called beforeZend_Controller_Frontcalls on the router to evaluate the request against the registered routes.routeShutdown()is called after the router finishes routing the request.dispatchLoopStartup()is called beforeZend_Controller_Frontenters its dispatch loop.preDispatch()is called before an action is dispatched by the dispatcher. This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (viaZend_Controller_Request_Abstract::setDispatched(false)), the current action may be skipped and/or replaced.postDispatch()is called after an action is dispatched by the dispatcher. This callback allows for proxy or filter behavior. By altering the request and resetting its dispatched flag (viaZend_Controller_Request_Abstract::setDispatched(false)), a new action may be specified for dispatching.dispatchLoopShutdown()is called afterZend_Controller_Frontexits its dispatch loop.




