src/widget/NavBar.php
public function init()
    {
        parent::init();
        $this->clientOptions = false;
        Html::addCssClass($this->options, 'navbar');
        if ($this->options['class'] === 'navbar') {
            Html::addCssClass($this->options, 'navbar-default');
        }
        
        if (empty($this->options['role'])) {
            $this->options['role'] = 'navigation';
        }
        $options = $this->options;
        $tag = ArrayHelper::remove($options, 'tag', 'nav');
        echo Html::beginTag($tag, $options);
        echo $this->renderToggleButton();        
        echo Html::beginTag('div', ['class' => 'navbar-right']);
    }
public function init()
    {
        parent::init();
        $this->clientOptions = false;
        Html::addCssClass($this->options, 'navbar');
        if ($this->options['class'] === 'navbar') {
            Html::addCssClass($this->options, 'navbar-default');
        }
        
        if (empty($this->options['role'])) {
            $this->options['role'] = 'navigation';
        }
        $options = $this->options;
        $tag = ArrayHelper::remove($options, 'tag', 'nav');
        echo Html::beginTag($tag, $options);
        echo $this->renderToggleButton();        
        echo Html::beginTag('div', ['class' => 'navbar-right']);
    }
Initializes the widget.