Beispiel #1
0
        </div>

        <div class="container bs-docs-container">
            <div class="row">
                <div class="col-md-2">
                    <div class="bs-sidebar hidden-print affix-top">
                        <?php 
$topMenu = LsYii::getApp()->controller->topMenu;
$menus = Menu::getMenuArray($topMenu, 3);
$html = '';
if ($menus) {
    $html .= '<ul class="nav bs-sidenav" style="height:567px">';
    foreach ($menus as $menu) {
        $html .= '<li class="active"><a href="javascript:void(0)"> ' . $menu->name . ' </a></li>';
        //查询四级子菜单
        $childMenus = Menu::getMenuArray($menu->id, 4);
        if ($childMenus) {
            $html .= '<ul class="nav">';
            foreach ($childMenus as $childMenu) {
                if (LsYii::getApp()->controller->sideMenu == $childMenu->id) {
                    $class = 'class="active"';
                } else {
                    $class = '';
                }
                $html .= '<li ' . $class . '><a href="' . Url::to([$childMenu->url]) . '">' . $childMenu->name . '</a></li>';
            }
            $html .= '</ul>';
        }
    }
    $html .= '</ul>';
}