Contrary to what my tutorial says, I'm one of those people that doesn't want to have to render my common header and footer templates in every single view script file. I prefer a standard site-wide layout script file that will display the content of the action script files within it.
The Zend_Controller_Action_Helper_ViewRenderer action helper is a great bit of code that automates rendering a view template based on which action has been called. This is very useful, but renders the action template, not my layout template. To solve this, I am experimenting with extending the Zend_Controller_Action_Helper_ViewRenderer and overriding it so that it know about my layout template. I also prefer to use the view suffix "tpl.php" for my view scripts, so I've made my class automatically set my preferred view suffix.
Author:
Rob Allen
Zend Framework Version:
1.0 RC 1
Rating
Rating: 8.50/10 (8 )
Comments
Comment Author ronnystalker / Jul 26, 2007
This article seems to have been moved to:
http://akrabat.com/2007/06/02/extending-viewrenderer-for-layouts/