src/Widgets/Bootstrap/NavBar.php
public function init()
    {
        parent::init();
        $this->clientOptions = false;
        if (empty($this->options['class'])) {
            Html::addCssClass($this->options, ['navbar', 'navbar-light bg-light']);
            Html::addCssClass($this->options, ['expand' => 'navbar-expand-md']);
        } else {
            Html::addCssClass($this->options, ['widget' => 'navbar']);
        }
        $options = $this->options;
        $tag = ArrayHelper::remove($options, 'tag', 'nav');
        echo $this->htmlHlp->beginTag($tag, $options);
        if ($this->renderInnerContainer) {
            if (!isset($this->innerContainerOptions['class'])) {
                Html::addCssClass($this->innerContainerOptions, 'container');
            }
            echo $this->htmlHlp->beginTag('div', $this->innerContainerOptions);
        }
        if (!isset($this->containerOptions['id'])) {
            $this->containerOptions['id'] = "{$this->options['id']}-collapse";
        }
        if ($this->brandLabel !== false) {
            Html::addCssClass($this->brandOptions, ['widget' => 'navbar-brand']);
            echo $this->htmlHlp->a($this->brandLabel, $this->brandUrl === false ? $this->app->getHomeUrl() : $this->brandUrl, $this->brandOptions);
        }
        echo $this->renderToggleButton();
        Html::addCssClass($this->containerOptions, ['collapse' => 'collapse', 'widget' => 'navbar-collapse']);
        $options = $this->containerOptions;
        $tag = ArrayHelper::remove($options, 'tag', 'div');
        echo $this->htmlHlp->beginTag($tag, $options);
    }
public function init()
    {
        parent::init();
        $this->clientOptions = false;
        if (empty($this->options['class'])) {
            Html::addCssClass($this->options, ['navbar', 'navbar-light bg-light']);
            Html::addCssClass($this->options, ['expand' => 'navbar-expand-md']);
        } else {
            Html::addCssClass($this->options, ['widget' => 'navbar']);
        }
        $options = $this->options;
        $tag = ArrayHelper::remove($options, 'tag', 'nav');
        echo $this->htmlHlp->beginTag($tag, $options);
        if ($this->renderInnerContainer) {
            if (!isset($this->innerContainerOptions['class'])) {
                Html::addCssClass($this->innerContainerOptions, 'container');
            }
            echo $this->htmlHlp->beginTag('div', $this->innerContainerOptions);
        }
        if (!isset($this->containerOptions['id'])) {
            $this->containerOptions['id'] = "{$this->options['id']}-collapse";
        }
        if ($this->brandLabel !== false) {
            Html::addCssClass($this->brandOptions, ['widget' => 'navbar-brand']);
            echo $this->htmlHlp->a($this->brandLabel, $this->brandUrl === false ? $this->app->getHomeUrl() : $this->brandUrl, $this->brandOptions);
        }
        echo $this->renderToggleButton();
        Html::addCssClass($this->containerOptions, ['collapse' => 'collapse', 'widget' => 'navbar-collapse']);
        $options = $this->containerOptions;
        $tag = ArrayHelper::remove($options, 'tag', 'div');
        echo $this->htmlHlp->beginTag($tag, $options);
    }
Initializes the widget.