Prev | Current Page 92 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

The default is obviously to render the layout and SiteTemplate
provides a helper function called setNoRenderLayout() to change this.
To render the layout, we retrieve the current body from the response and assign as a variable in the view
(#2). This contains the content from the actions as rendered by the standard ViewRenderer action helper.
Finding the master layout script name is delegated to a helper function, getLayoutScript() to allow for
overriding the default site.phtml (#3) and then it is rendered and assigned to the response (#4).
To get a reference to the SiteTemplate plug-in, you can use the code:
$front = Zend_Controller_Front::getInstance();
$st = $front->getPlugin('SiteTemplate');
This allows access to the two main control functions:
$st->setNoRenderLayout(); and $st->setLayoutScript();
We have now implemented the Two-Step view using a Front Controller plug-in which has resulted in a
fully automated solution. This means that within our action functions we do not have to think about rendering
the master layout as it will all be handled for us. Let??™s look now at the home page of the Places website.
3.4 The Home Page
The home page is the shop front to our application and so we want to ensure that we provide an attractive page
with easy to use navigation.


Pages:
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
doktorat lampy ogrodowe określić zakłady bukmacherskie Wczasy nad morzem