Prev | Current Page 90 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

In our case, we will store them in lib/Places/View/Helper
which mimics the location of the global view helpers provided by the Zend Framework.
After the Front Controller has started this dispatch loop, it calls the preDispatch() function of all registered
plugins. SiteTemplate??™s preDispatch() function performs the per-action initialization and sets up some useful
variables for use in our view templates:
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
// set up common variables for the view
$this->_view->baseUrl = $request->getBaseUrl();
$this->_view->module = $request->getModuleName();
$this->_view->controller = $request->getControllerName();
$this->_view->action = $request->getActionName();
}
As you can see, this is a very simple function that doesn??™t need further explanation. All it does is ensure
that when we are within a view template, we have easy access to the information on the module, controller,
action. We also pass through the baseUrl which is useful for referencing images, JavaScript and CSS files.
After dispatching has completed, the Front Controller calls the dispatchLoopShutdown() function for all
registered plugins. This is the plugins??™ last chance to do anything before the response is sent back to the
browser.


Pages:
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
prezenty pieniny noclegi agencja reklamowa poznań sypialnia yerba mate