コード例 #1
0
ファイル: Alert.php プロジェクト: diginova/yii2-metronic
 /**
  * Initializes the widget.
  */
 public function init()
 {
     Html::addCssClass($this->options, 'alert-' . $this->type);
     if ($this->block) {
         Html::addCssClass($this->options, 'alert-block');
     }
     parent::init();
 }
コード例 #2
0
ファイル: Alert.php プロジェクト: nsanden/Yii2-AspectMock
 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();
 }