/** * Initializes the widget. */ public function init() { Html::addCssClass($this->options, 'alert-' . $this->type); if ($this->block) { Html::addCssClass($this->options, 'alert-block'); } parent::init(); }
public function init() { if ($this->body = \Yii::$app->getSession()->getFlash('error')) { Html::addCssClass($this->options, 'alert-error'); } elseif ($this->body = \Yii::$app->getSession()->getFlash('success')) { Html::addCssClass($this->options, 'alert-success'); } elseif ($this->body = \Yii::$app->getSession()->getFlash('info')) { Html::addCssClass($this->options, 'alert-info'); } elseif ($this->body = \Yii::$app->getSession()->getFlash('warning')) { } else { $this->_doNotRender = true; return; } parent::init(); }