original_string: protected function renderItems(\MUtil_Html_ListElement $ul, array $items, $cascade)
      {
          foreach ($items as $item) {
              if (isset($item['visible'], $item['label']) && $item['visible'] && $item['label']) {
                  $url = $item['params'];
                  $url['controller'] = $item['controller'];
                  $url['action']     = $item['action'];
                  $url['RouteReset'] = true;
                  $li = $ul->li();
                  if (isset($item['active']) && $item['active']) {
                      $li->class = 'active';
                  }
                  if (isset($item['liClass']) && $item['liClass']) {
                      $li->appendAttrib('class', $item['liClass']);
                  }
  
                  $a = $li->a($url, $item['label']);
                  if (isset($item['class'])) {
                      $a->class = $item['class'];
                  }
                  if (isset($item['target'])) {
                      $a->target = $item['target'];
                  }
  
                  if ($cascade && isset($item['pages']) && is_array($item['pages'])) {
                      $this->renderItems($li->ul(array('class' => 'subnav '. $this->_menuUlClass)), $item['pages'], true);
                  }
              }
          }
      }
code: protected function renderItems(\MUtil_Html_ListElement $ul, array $items, $cascade)
      {
          foreach ($items as $item) {
              if (isset($item['visible'], $item['label']) && $item['visible'] && $item['label']) {
                  $url = $item['params'];
                  $url['controller'] = $item['controller'];
                  $url['action']     = $item['action'];
                  $url['RouteReset'] = true;
                  $li = $ul->li();
                  if (isset($item['active']) && $item['active']) {
                      $li->class = 'active';
                  }
                  if (isset($item['liClass']) && $item['liClass']) {
                      $li->appendAttrib('class', $item['liClass']);
                  }
  
                  $a = $li->a($url, $item['label']);
                  if (isset($item['class'])) {
                      $a->class = $item['class'];
                  }
                  if (isset($item['target'])) {
                      $a->target = $item['target'];
                  }
  
                  if ($cascade && isset($item['pages']) && is_array($item['pages'])) {
                      $this->renderItems($li->ul(array('class' => 'subnav '. $this->_menuUlClass)), $item['pages'], true);
                  }
              }
          }
      }
code_tokens: protected function renderItems ( \ MUtil_Html_ListElement $ ul , array $ items , $ cascade ) { foreach ( $ items as $ item ) { if ( isset ( $ item [ 'visible' ] , $ item [ 'label' ] ) && $ item [ 'visible' ] && $ item [ 'label' ] ) { $ url = $ item [ 'params' ] ; $ url [ 'controller' ] = $ item [ 'controller' ] ; $ url [ 'action' ] = $ item [ 'action' ] ; $ url [ 'RouteReset' ] = true ; $ li = $ ul -> li ( ) ; if ( isset ( $ item [ 'active' ] ) && $ item [ 'active' ] ) { $ li -> class = 'active' ; } if ( isset ( $ item [ 'liClass' ] ) && $ item [ 'liClass' ] ) { $ li -> appendAttrib ( 'class' , $ item [ 'liClass' ] ) ; } $ a = $ li -> a ( $ url , $ item [ 'label' ] ) ; if ( isset ( $ item [ 'class' ] ) ) { $ a -> class = $ item [ 'class' ] ; } if ( isset ( $ item [ 'target' ] ) ) { $ a -> target = $ item [ 'target' ] ; } if ( $ cascade && isset ( $ item [ 'pages' ] ) && is_array ( $ item [ 'pages' ] ) ) { $ this -> renderItems ( $ li -> ul ( array ( 'class' => 'subnav ' . $ this -> _menuUlClass ) ) , $ item [ 'pages' ] , true ) ; } } } }
docstring: Helper function to load the menu items to the html element.
  
  Allows overloading by sub classes.
  
  @param \MUtil_Html_ListElement $ul
  @param array $items
  @param boolean $cascade render nested items
docstring_tokens: Helper function to load the menu items to the html element .