Skip to content

Instantly share code, notes, and snippets.

@ixti
Created February 9, 2010 13:10
Show Gist options
  • Save ixti/299185 to your computer and use it in GitHub Desktop.
Save ixti/299185 to your computer and use it in GitHub Desktop.
<?php
$n_pages = count($this->pages);
if (0 < $n_pages) {
echo $this->pages[0]->getLabel();
for ($i = 1; $i < $n_pages; $i++) {
echo ' &raquo; ' . $this->pages[$i]->getLabel();
}
$last_page = $this->pages[$n_pages - 1];
if (isset($last_page->demoName)) {
echo ' &raquo; ' . $last_page->demoName;
}
}
<?php
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{}
public function demoAction()
{
$page = Zend_Registry::get('Zend_Navigation')->findOneBy('active', true);
if (null !== $page) {
$page->demoName = 'Hi, there!';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment