Пример #1
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, $this->size);
     Html::addCssClass($this->options, 'material-icons');
 }
Пример #2
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     if (empty($this->options['class'])) {
         Html::addCssClass($this->options, self::DEFAULT_OPTIONS);
     }
     if (empty($this->options['role'])) {
         $this->options['role'] = 'navigation';
     }
     if (empty($this->wrapperContainerOptions['class'])) {
         Html::addCssClass($this->wrapperContainerOptions, self::DEFAULT_WRAPPER_CONTAINER_OPTIONS);
     }
     $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');
     $tag = ArrayHelper::remove($this->options, 'tag', 'nav');
     echo Html::beginTag($tag, $this->options);
     echo Html::beginTag('div', $this->wrapperContainerOptions);
     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);
     }
 }
Пример #3
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);
     }
 }
Пример #4
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']);
         }
     }
 }
Пример #5
0
 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     if (empty($this->options['class'])) {
         Html::addCssClass($this->options, self::DEFAULT_OPTIONS);
     }
     if ($this->buttonCollapse) {
         if (empty($this->buttonCollapseOptions['data-activates'])) {
             $this->buttonCollapseOptions['data-activates'] = $this->getMobileId();
         }
         Html::addCssClass($this->buttonCollapseOptions, 'button-collapse');
         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');
 }
Пример #6
0
 /**
  * added default options to user settings
  */
 public function init()
 {
     parent::init();
     $this->addDefaultOptions($this->options, $this->defaultOptions, $this->forceUseDefaultClasses);
     $this->addDefaultOptions($this->dropdownOptions, $this->defaultDropdownOptions, $this->forceUseDefaultClasses);
     $this->addDefaultOptions($this->clientOptions, $this->defaultClientOptions);
     $this->dropdownOptions['id'] = $this->options['data-activates'] = $this->getDropdownId();
     if ($this->isButton) {
         Html::addCssClass($this->options, 'btn');
     }
 }