src/View/Helper/Navigation/Navbar.php
protected function renderNavbarMenuPage(AbstractPage $page, array $options, $depth, $prevDepth)
    {
        // Check for depth
        $html = '';
        
        if ($depth > $prevDepth) {
            // Start new ul tag
            $ulClass = $this->createNavbarMenuClass($page, $options['ulClass'], $depth);
            $html .= '<ul' . $ulClass . '>';
        } elseif ($depth < $prevDepth) {
            // Close open li/ul tags until we're at current depth
            for ($i = $prevDepth; $i > $depth; $i--) {
                $html .= '</li></ul>';
            }
            // Close previous li tag
            $html .= '</li>';
        } elseif ($depth == $prevDepth) {
            // Close previous li tag
            $html .= '</li>';
        }

        // Check for divider
        if ($page->get('divider')) {
            $html .= '<li class="divider"></li>';
        }
        
        // Check if page is empty
        if ($this->isPageEmpty($page)) {
            return $html;
        }
        
        // Add menu item
        $liClass = $this->createNavbarMenuItemClass($page, $options['addClassToLi'], $depth);
        $html .= '<li' . $liClass . '>' . $this->htmlify(
            $page,
            $options['addClassToLi'],
            $options['iconPosition'],
            $depth >= self::MAX_RENDER_DEPTH
        );

        return $html;
    }
protected function renderNavbarMenuPage(AbstractPage $page, array $options, $depth, $prevDepth)
    {
        // Check for depth
        $html = '';
        
        if ($depth > $prevDepth) {
            // Start new ul tag
            $ulClass = $this->createNavbarMenuClass($page, $options['ulClass'], $depth);
            $html .= '<ul' . $ulClass . '>';
        } elseif ($depth < $prevDepth) {
            // Close open li/ul tags until we're at current depth
            for ($i = $prevDepth; $i > $depth; $i--) {
                $html .= '</li></ul>';
            }
            // Close previous li tag
            $html .= '</li>';
        } elseif ($depth == $prevDepth) {
            // Close previous li tag
            $html .= '</li>';
        }

        // Check for divider
        if ($page->get('divider')) {
            $html .= '<li class="divider"></li>';
        }
        
        // Check if page is empty
        if ($this->isPageEmpty($page)) {
            return $html;
        }
        
        // Add menu item
        $liClass = $this->createNavbarMenuItemClass($page, $options['addClassToLi'], $depth);
        $html .= '<li' . $liClass . '>' . $this->htmlify(
            $page,
            $options['addClassToLi'],
            $options['iconPosition'],
            $depth >= self::MAX_RENDER_DEPTH
        );

        return $html;
    }
protected function renderNavbarMenuPage ( AbstractPage $ page , array $ options , $ depth , $ prevDepth ) { // Check for depth $ html = '' ; if ( $ depth > $ prevDepth ) { // Start new ul tag $ ulClass = $ this -> createNavbarMenuClass ( $ page , $ options [ 'ulClass' ] , $ depth ) ; $ html .= '<ul' . $ ulClass . '>' ; } elseif ( $ depth < $ prevDepth ) { // Close open li/ul tags until we're at current depth for ( $ i = $ prevDepth ; $ i > $ depth ; $ i -- ) { $ html .= '</li></ul>' ; } // Close previous li tag $ html .= '</li>' ; } elseif ( $ depth == $ prevDepth ) { // Close previous li tag $ html .= '</li>' ; } // Check for divider if ( $ page -> get ( 'divider' ) ) { $ html .= '<li class="divider"></li>' ; } // Check if page is empty if ( $ this -> isPageEmpty ( $ page ) ) { return $ html ; } // Add menu item $ liClass = $ this -> createNavbarMenuItemClass ( $ page , $ options [ 'addClassToLi' ] , $ depth ) ; $ html .= '<li' . $ liClass . '>' . $ this -> htmlify ( $ page , $ options [ 'addClassToLi' ] , $ options [ 'iconPosition' ] , $ depth >= self :: MAX_RENDER_DEPTH ) ; return $ html ; }
Render navbar menu page

@param  AbstractPage $page      Page to render
@param  array        $options   Options for controlling rendering
@param  integer      $depth     Current iteration depth
@param  integer      $prevDepth Previous iteration depth
@return string
Render navbar menu page