/** * Initializes the widget. * If you override this method, make sure you call the parent implementation first. */ public function init() { parent::init(); if (!$this->sideNav) { 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; }
public function init() { parent::init(); if ($this->id) { $this->_item = Article::findOne($this->id); } else { throw new InvalidParamException(\Yii::t('front', 'No required parameter given') . ' - id'); } if (!$this->articleType) { $this->articleType = 'normal'; } }
/** * 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); } }
public function init() { parent::init(); $this->setImage(); }
public function init() { parent::init(); $this->setWeather(); }
public function init() { parent::init(); $this->setForecast(); }
/** * 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; 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(); } }