I have a layout with 4 separate "chunks". They are:
- A nav panel with a menu and breadcrumbs. This is constructed using Zend_Navigation.
- A sidebar, which shows general "news" by default
- A content area, where the main output from each controller action would be placed
- A header area, which is the above the navigation, which normally displays just some stock text and a photo.
The content area fits in with the traditional single view model that the documentation for Zend_Application states, but the other three do not. They all have reasonable default views to use, but a controller needs to be able to override them if needed. For example, it makes sense for an administration page to override the "newsy" view to display a log of recent administrative actions taken on the system.
The Zend_Layout
/Zend_Application
examples, however, all assume a single view (they call <?php echo $this->layout()->content; ?>
.
How can one accomplish this kind of overriding of the layout? The only solution I've thought of would be to store overridden Zend_View
s inside Zend_Registry
, but that seems like holding things together with duct tape ;)