menu
Menu::widget( [ [ ‘label‘ => $menu[‘name‘], ‘url‘ => [$menu[‘route‘]], ‘items‘ => [ [ ‘label‘ => $menu[‘name‘], ‘url‘ => [$menu[‘route‘]] ], .... ] ], [ ‘label‘ => $menu[‘name‘], ‘url‘ => [$menu[‘route‘]], ‘items‘ => [ [ ‘label‘ => $menu[‘name‘], ‘url‘ => [$menu[‘route‘]] ] ] ], .. ] );
navbar&&nav
NavBar::begin([ ‘brandLabel‘ => ‘My Company‘, ‘brandUrl‘ => Yii::$app->homeUrl, ‘options‘ => [ ‘class‘ => ‘navbar-inverse navbar-fixed-top‘, ], ]); $menuItems = [ [‘label‘ => ‘Home‘, ‘url‘ => [‘/site/index‘]], [‘label‘ => ‘About‘, ‘url‘ => [‘/site/about‘]], [‘label‘ => ‘Contact‘, ‘url‘ => [‘/site/contact‘]], ]; echo Nav::widget([ ‘options‘ => [‘class‘ => ‘navbar-nav navbar-right‘], ‘items‘ => $menuItems, ]); NavBar::end();
时间: 2024-10-12 19:16:30