Any content enclosed between the [[begin()]] and [[end()]] calls of NavBar
is treated as the content of the navbar. You may use widgets such as Nav
or Menu to build up such content. For example,
php
use yii\bootstrap\NavBar;
use yii\bootstrap\Nav;
NavBar::begin(['brandLabel' => 'NavBar Test']);
echo Nav::widget([
'items' => [
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'About', 'url' => ['/site/about']],
],
'options' => ['class' => 'navbar-nav'],
]);
NavBar::end();