Example #1
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     if ($this->fixed) {
         if (!isset($this->fixedContainerOptions['class'])) {
             Html::addCssClass($this->fixedContainerOptions, 'navbar-fixed');
         }
         echo Html::beginTag('div', $this->fixedContainerOptions);
     }
     Html::addCssClass($this->brandOptions, 'brand-logo');
     $options = $this->options;
     $tag = ArrayHelper::remove($options, 'tag', 'nav');
     echo Html::beginTag($tag, $options);
     if (!isset($this->wraperContainerOptions['class'])) {
         Html::addCssClass($this->wraperContainerOptions, 'nav-wrapper');
     }
     echo Html::beginTag('div', $this->wraperContainerOptions);
     if ($this->brandLabel !== false) {
         Html::addCssClass($this->brandOptions, 'brand-logo');
         echo Html::a($this->brandLabel, $this->brandUrl === false ? Yii::$app->homeUrl : $this->brandUrl, $this->brandOptions);
     }
     if ($this->brandMobileLabel !== false) {
         Html::addCssClass($this->brandMobileOptions, 'brand-logo');
         echo Html::a($this->brandMobileLabel, $this->brandUrl === false ? Yii::$app->homeUrl : $this->brandUrl, $this->brandMobileOptions);
     }
 }
Example #2
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     if ($this->defaultClass) {
         Html::addCssClass($this->options, $this->defaultClass);
     }
 }
Example #3
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, 'dropdown-content');
     Html::addCssClass($this->buttonOptions, 'btn');
     Html::addCssClass($this->buttonOptions, 'dropdown-button');
     $this->buttonOptions['id'] = $this->id . '-btn';
     $this->buttonOptions['data-activates'] = $this->id;
 }
Example #4
0
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     Html::addCssClass($this->options, 'modal');
     $session = \Yii::$app->session;
     $flashes = $session->getAllFlashes();
     if (!empty($flashes)) {
         foreach ($flashes as $type => $message) {
             Html::addCssClass($this->options, $type);
             $this->message = $message;
             if ($type !== 'error') {
                 $this->headMessage = $type !== 'error' ? 'Ваше сообщение отправлено' : 'Ошибка';
             }
             $session->removeFlash($type);
         }
         $this->view->registerJs('$(".modal").openModal()', View::POS_END);
     }
 }
Example #5
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     Html::addCssClass($this->wrapOptions, 'progress');
     if ($this->determinate) {
         Html::addCssClass($this->options, 'determinate');
     } else {
         Html::addCssClass($this->options, 'indeterminate');
     }
     if ($this->percent) {
         if (!isset($this->options['style'])) {
             $this->options['style'] = 'width: ' . $this->percent . '%';
         } else {
             $this->options['style'] = explode(';', trim($this->options['style'], ';'));
             $this->options['style'][] = 'width: ' . $this->percent . '%;';
             $this->options['style'] = implode(';', $this->options['style']);
         }
     }
 }
Example #6
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     Html::addCssClass($this->options, 'fa ' . $this->name);
 }
Example #7
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     if ($this->buttonCollapse) {
         Html::addCssClass($this->buttonCollapseOptions, 'button-collapse');
         $this->buttonCollapseOptions['id'] = $this->id . '-button-collapse';
         $this->buttonCollapseOptions['data-activates'] = $this->id . '-mobile';
         echo Html::a($this->buttonCollapseLabel, '#', $this->buttonCollapseOptions);
     }
     if ($this->route === null && Yii::$app->controller !== null) {
         $this->route = Yii::$app->controller->getRoute();
     }
     if ($this->params === null) {
         $this->params = Yii::$app->request->getQueryParams();
     }
     Html::addCssClass($this->options, 'nav');
 }
Example #8
0
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
 }
Example #9
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, $this->defaultClass);
 }