-- David Mintz <[EMAIL PROTECTED]> wrote
(on Monday, 18 June 2007, 01:14 PM -0400):
> A couple Q's about views. Sorry if I've overlooked this in the docs.
>
> (1) What's the recommended practice for including one view inside another? I
> am
> thinking off site-wide navigation and footers and such.
There are several ways. I usually use a Two Step view for the sort of
thing you're describing; search the mailing lists for some examples I've
posted.
The other way many implement these is by simply rendering other views
within your view script:
<?= $this->render('foo.phtml') ?>
> (2) What is the current way of changing the template suffix? Overriding the
> viewSuffix var in my controllers has no effect.
This changed in RC1 with the introduction of the ViewRenderer. Grab the
ViewRenderer object and manipulate it:
// Within an action controller:
$viewRenderer = $this->_helper->getHelper('viewRenderer');
$viewRenderer->setViewSuffix('php');
// Within a front controller plugin:
$viewRenderer =
Zend_Controller_Action_HelperBroker::getExistingHelper('viewRenderer');
$viewRenderer->setViewSuffix('php');
// Create and register your own customied view renderer:
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setViewSuffix('php');
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/