Ejemplo n.º 1
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     if ($this->route === null && Yii::$app->controller !== null) {
         $this->route = Yii::$app->controller->getRoute();
     }
     if ($this->params === null) {
         $this->params = $_GET;
     }
     Html::addCssClass($this->options, $this->navbar ? 'uk-navbar-nav' : 'uk-nav');
     if ($this->accordion) {
         $this->options['data-uk-nav'] = $this->jsonClientOptions();
     }
 }
Ejemplo n.º 2
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     Html::addCssClass($this->options, 'uk-navbar');
     if (empty($this->options['role'])) {
         $this->options['role'] = 'navigation';
     }
     echo Html::beginTag('nav', $this->options);
     if ($this->container) {
         echo Html::beginTag('div', ['class' => 'uk-container uk-container-center']);
     }
     if ($this->offcanvas) {
         echo Html::a('', '#' . ($this->offcanvas === true ? 'offcanvas' : $this->offcanvas), ['class' => 'uk-navbar-toggle uk-visible-small', 'data-uk-offcanvas' => true]);
     }
     if ($this->brandLabel !== false) {
         Html::addCssClass($this->brandOptions, ['widget' => 'uk-navbar-brand']);
         echo Html::a($this->brandLabel, $this->brandUrl === false ? Yii::$app->homeUrl : $this->brandUrl, $this->brandOptions);
     }
 }