Prev | Current Page 54 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

All plug-ins are derived from
Zend_Controller_Plugin_Abstract and there are six event methods that can be overridden:
1. routeStartup() is called just before the router is executed.
2. dispatchLoopStartup() is called just before the dispatcher starts executing.
3. preDispatch() is called before each action is executed.
4. postDispatch() is called after each action is executed.
5. dispatchLoopShutdown() is called after all actions have been dispatched.
6. routeShutdown() is called after the router has finished.
As you can see, there are three pairs of hooks into the process at three different points which allow for
increasingly finer control of the process.
One problem with the current router is that if you specify a controller that does not exist, then an exception
is thrown. A front controller plug-in is a good way to inject a solution into the routing process and redirect to a
more useful page. The Zend Framework supplies the ErrorHandler plug-in for this purpose and it??™s use is very
well explained in the manual.
Now that we have looked in detail at the controller part of MVC, it??™s time to look at the View part as
provided for by the Zend_View component.
2.6.2 Understanding Zend_View
Zend_View is a class for keeping the view portion of an MVC application separated from the rest of the
application.


Pages:
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
ceny żywca aplikacje internetowe Kalkulator kredytowy Pompy zanurzeniowe instant loans online