use yii\bootstrap\Nav; echo Nav::widget([ 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ['label' => 'About', 'url' => ['/site/about']], ['label' => 'Contact', 'url' => ['/site/contact']], ], ]);
use yii\bootstrap\Nav; echo Nav::widget([ 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ['label' => 'About', 'url' => ['/site/about']], [ 'label' => 'Dropdown', 'items' => [ ['label' => 'Action', 'url' => '#'], ['label' => 'Another action', 'url' => '#'], ['label' => 'Something else here', 'url' => '#'], '', ['label' => 'Separated link', 'url' => '#'], ], ], ], ]); This code will generate a horizontal navigational menu with a dropdown menu labeled "Dropdown" that contains some options. Overall, Yii.bootstrap is a package library for Yii PHP web application framework that provides integration of Bootstrap front-end framework with Yii. Nav is a widget provided by Yii.bootstrap for generating a navigational menu element. The code examples show how to use the Nav widget to generate a basic horizontal navigational menu or a dropdown navigational menu with options.