Prev | Current Page 87 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

4 where we have a master template (site.phtml) providing the overall layout and the action template
containing the action specific content.
Figure 3.4: Two view templates make up the complete page.
The master template contains those parts of the page that do not change much, such as the header, footer
and menu sections, and is site.phtml. The action template contains the display code specific to the action being
dispatched. The current ViewRenderer ensures that all action template files related to one controller will be
stored in a sub directory named after the controller. That is, if we have a controller called reviews, then the
index action??™s view template is called index.phtml and resides in the reviews sub-directory. The master layout
templates will reside directly in the views/ directory.
There are multiple ways to apply the Two-Step view to the MVC system within the Zend Framework and
we are going to use a Front Controller plug in called SiteTemplate. Front Controller plug-ins allow us to inject
functionality into the dispatching flow in order to alter the default behaviour. SiteTemplate will collect the
view output from any actions that have been run and then place the content into a master template and render
it. A plug-in for the front controller can implement a number of functions, known as hooks, that the front
controller will call at different stages in the dispatch cycle.


Pages:
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
zakłady bukmacherskie ziemme.bizor.pl ścianki biurowe baseny ogrodowe zakłady bukmacherskie