title: Zend Framework: Navigation items remain visible
body: <p>I can't figure out why this is not working. The item element always remains visible. I am using the latest release and my menu looks like:</p>
  
  <pre><code>public function hook_menu()
  {
      $menu['menuPageController'] = array(
          array(
              'label' =&gt; 'Start',
              'controller' =&gt; 'page',
              'action' =&gt; 'index'
          ),
          array(
              'label' =&gt; 'Produkter',
              'controller' =&gt; 'page',
              'action' =&gt; 'products',
              'class' =&gt; 'beyond',
              'pages' =&gt; array(
                      array(
                          'label' =&gt; 'default list a',
                          'controller' =&gt; 'page',
                          'action' =&gt; 'products',
                          'class' =&gt; 'beyond',
                          'params' =&gt; array(
                              'lista' =&gt; 'a')
                      ),
                      array(
                          'label' =&gt; 'list b',
                          'controller' =&gt; 'page',
                          'action' =&gt; 'products',
                          'class' =&gt; 'beyond',
                          'params' =&gt; array(
                              'listb' =&gt; 'b')
                      ),
  
                      array(
                          'label' =&gt; 'list c',
                          'controller' =&gt; 'page',
                          'action' =&gt; 'products',
                          'class' =&gt; 'beyond',
                          'params' =&gt; array(
                              'listc' =&gt; 'c')
                      ),
  
                  )
          ),
          array(
              'label' =&gt; 'item',
              'controller' =&gt; 'page',
              'action' =&gt; 'product',
              'visible' =&gt; false,
              'params' =&gt; array(
              'id' =&gt; null)
          ),
          array(
              'label' =&gt; 'Filhanteraren',
              'controller' =&gt; 'page',
              'action' =&gt; 'filemanager'
          )
      );
      return $menu;
  }
  </code></pre>
  
  <p>In the layout:</p>
  
  <pre><code>&lt;div id="navigation-bar"&gt;
      &lt;?php 
      // menu.phtml is partial, cms is module
      $partial = 'partials/main-menu.phtml';
      $this-&gt;navigation()-&gt;menu()-&gt;setPartial($partial);
      $this-&gt;navigation()-&gt;menu()-&gt;setRenderInvisible(false);
      echo $this-&gt;navigation()-&gt;menu()-&gt;render(); ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I don't think it's the problem but here's the partial anyway</p>
  
  <pre><code>&lt;?php
  // -- main-menu.phtml
  $html = array();
  $html[] = '&lt;ul class="navigation"&gt;';
  
  foreach (Zend_Registry::get('main') as $page) 
  {
  
      $check = $page-&gt;isActive();
      if($check)
      {
          $marker = "active";
      }
      else
      {
          $marker = "inactive";
      }
          $html[] = '&lt;li class="' . $marker . '"&gt;';
          $html[] = $this-&gt;menu()-&gt;htmlify($page) . PHP_EOL;
          $html[] = "&lt;/li&gt;";
   }
  
  $html[] = "&lt;/ul&gt;";
  
  print ('&lt;div id="main-menu"&gt;' . join(PHP_EOL, $html) . '&lt;/div&gt;');   
  
  // get the page asked for
  $uri = Zend_Controller_Front::getInstance()-&gt;getRequest()-&gt;getRequestUri();
  $con = Zend_Controller_Front::getInstance()-&gt;getRequest()-&gt;getControllerName();
  $act = Zend_Controller_Front::getInstance()-&gt;getRequest()-&gt;getActionName();
  
  // check for child pages
  $list = Zend_Registry::get('main');
  $menuItems = $list-&gt;toArray();
  $function = new AppFiles_Functions_FunctionsHooks();
  $current = $list-&gt;findOneBy('action', $act);
  $isChildof = $function-&gt;find_parent($menuItems, $act);
  
  print($isChildof);
  
    $subhtml = '&lt;ul class="navigation"&gt;';
              foreach ($current-&gt;pages as $subpage) 
              {
  
                  $check = $subpage-&gt;isActive();
                  if($check)
                  {
                      $submarker = "active";              
  
                  }
                  else
                  {
                      $submarker = "inactive";
  
                  }
                  $subhtml .= '&lt;li class="' . $submarker . '"&gt;';
                  if ($href = $subpage-&gt;getHref()) $subhtml .= "&lt;a href=\"{$href}\"&gt;";
                  else $subhtml .= "&lt;span&gt;";
  
  
                  $subhtml .= $subpage-&gt;getLabel();
  
                  if ($href) $subhtml .= "&lt;/a&gt;";
                  else $subhtml .= "&lt;/span&gt;";
  
                  $subhtml .= "&lt;/li&gt;";
  
  
                  $subitem[$subpage-&gt;getHref()] = '';
  
              }
      $subhtml .= "&lt;/ul&gt;";
  
  // print a container for the child pages            
  
   ?&gt;
  
  &lt;div id="sub-menu" class=""&gt;
  &lt;?php echo $subhtml; ?&gt;
  &lt;/div&gt;
  &lt;?php
  print($uri);
  print "\n&lt;br /&gt;";
  print($con);
  print "\n&lt;br /&gt;";
  print($act);
  print "\n&lt;br /&gt;";
  ?&gt;
  </code></pre>