As the title suggests, I'm trying to find a way of displaying the title of the View currently being displayed as part of the layout. I'm trying to do this so that the page title is dynamicly populated when a different view is selected.
In psuedocode:
<div>
<div id="header"><h1>My website</h1></div>
<div id="main">
<?php echo "<h2>" . SOME WAY OF ECHOING THE VIEW NAME HERE . "</h2>"; ?>
<?php echo $this->layout()->content; ?>
</div>
<div id="footer"><p>2011 My website.com></p>
</div>
I've been through the Zend documentation and the closest thing I could find was the headlink. However, I was unable to get the value from this helper and shoehorn it into a variable so that I could display its text as a page header for the view.
Thanks.
You could pass the action name (or combine with the module if needed) to the layout within the controller.
$layout = $this->_helper->layout->getLayoutInstance(); $layout->viewName = $this->_getParam("action");
Kind of dirty, but it would work