Skip to content

Instantly share code, notes, and snippets.

@localheinz
Created December 11, 2012 15:18
Show Gist options
  • Save localheinz/4259243 to your computer and use it in GitHub Desktop.
Save localheinz/4259243 to your computer and use it in GitHub Desktop.
Navigation view helper plugin prepends the normalised name of the plugin to the id of a page, if specified
<?php /* @var $container Zend\Navigation\Navigation */ ?>
<?php if ($container->hasPages()): ?>
<ul>
<?php foreach ($container->getPages() as $page): ?>
<?php /* @var $page Zend\Navigation\Page\AbstractPage */ ?>
<?php if ($page->isVisible()): ?>
<li><?php echo $this->navigation()->menu()->htmlify($page); ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php
return array(
'navigation' => array(
'default' => array(
'example' => array(
'label' => 'Example',
'id' => 'example',
'uri' => '#',
),
),
),
);
<ul>
<li><a href="#" id="menu-example">Example</a></li>
</ul>
<ul>
<li><a href="#" id="example">Example</a></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment