How can I use multiple views in a Zend_Application (using Zend_Layout)?

Jazzed

New Member
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 \[code\]Zend_Layout\[/code\]/\[code\]Zend_Application\[/code\] examples, however, all assume a single view (they call \[code\]<?php echo $this->layout()->content; ?>\[/code\].How can one accomplish this kind of overriding of the layout? The only solution I've thought of would be to store overridden \[code\]Zend_View\[/code\]s inside \[code\]Zend_Registry\[/code\], but that seems like holding things together with duct tape ;)
 
Back
Top