I don't know if this is a better way, but you could call
$this->_helper->viewRenderer->setNoRender(false) after the render('sidebar')
call. The noRender flag is always set to true after calling render once. The
behavior is hard coded in the ViewRenderer helper and there's no option to
turn it off.-- Mon On Sun, Nov 15, 2009 at 9:12 PM, Gabriel Malkas <[email protected]>wrote: > Hi, > > I use Zend_Layout and I need to render a different 'navbar' accordingly to > the active action. I simply wrote this in my layout.phtml file : > > <?php echo $this->layout()->sidebar; ?> > > Then, in every action that needs to display a sidebar, I have : > $this->render('sidebar', 'sidebar'); > > This works since it renders the sidebar.phtml script, but it doesn't render > the action-name.phtml script anymore. It's possible to render both scripts > but I have to add a line : > $this->render('sidebar', 'sidebar'); > $this->render('index', 'default'); > > Now this does exactly what I need, but it's cumbersome since the action's > script "should" be rendered automatically anyway. Is it possible ? > > Is there a better way to achieve that ? > > Thanks. > Regards, > Gabriel. >
