Ejemplo de un menú Navigation
Código PHP:
'navigation' => array(
// The DefaultNavigationFactory we configured in (1) uses 'default' as the sitemap key
'default' => array(
// And finally, here is where we define our page hierarchy
array(
'label' => 'Navigation',
'route' => 'home',
'controller' => 'index',
'action' => 'index',
'pages' => array(
array(
'label' => 'ApplicationTopMenu',
'route' => 'navigation',
'controller' => 'index',
'action' => 'index',
'pages' => array(
array(
'label' => 'Home',
'iclass' => 'icon-home',
'route' => 'home',
),
array(
'label' => 'Navigation',
'route' => 'navigation',
),
array(
'label' => 'System Requirements',
'uri' => '/',
),
array(
'label' => '',
'liclass' => 'divider-vertical',
'uri' => '',
),
array(
'label' => 'Dropdown',
'liclass' => 'dropdown',
'iclass' => 'icon-book',
'class' => 'dropdown-toggle',
'uri' => '/',
'pages' => array(
array(
'label' => 'Drop1',
'uri' => '/',
),
array(
'label' => 'Drop2',
'uri' => '/',
),
array(
'label' => '',
'liclass' => 'divider',
'uri' => '',
),
array(
'label' => 'Drop3',
'iclass' => 'icon-book',
'uri' => '/',
),
),
),
),
),
),
),
),
),
Ejemplo de un menú header con dropdown:
Código PHP:
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<!--a class="brand" href="#">ga</a-->
<div class="nav-collapse">
<?php
$label = $this->navigation('navigation')->findOneByLabel('ApplicationTopMenu');
$options = array('ulClass' => 'nav');
echo $this->navigation()->navigationMenu()->renderMenu($label, $options);
?>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
Ejemplo de un menú vertical:
Para ver más aspectos revisar la doc css de bootstrap twitter. Código PHP:
<div class="row">
<div class="span3">
<?php
$label = $this->navigation('navigation')->findOneByLabel('ApplicationTopMenu');
$options = array('ulClass' => 'nav nav-tabs nav-stacked');
?>
<?php echo $this->navigation('navigation')
->navigationMenu() //view helper
//->setOnlyActiveBranch(false) //Rendering only the active branch of a menu
//->setRenderParents(false) //Rendering only the active branch of a menu with maximum depth and no parents
//->setMaxDepth(0) //profuncidad de submenus or MinDepth
->renderMenu($label, $options); ?>
</div>
</div>
PD.: Lógicamente, cualquier mejora es bienvenida.
Saludos,