From e1061f19acc7ac083fee9c80984461313d67abdb Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 24 Sep 2013 12:07:41 +0400 Subject: [PATCH] Advanced application template: Delete flash message after it was displayed --- apps/advanced/frontend/widgets/Alert.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/advanced/frontend/widgets/Alert.php b/apps/advanced/frontend/widgets/Alert.php index 20f3372..b68bfb0 100644 --- a/apps/advanced/frontend/widgets/Alert.php +++ b/apps/advanced/frontend/widgets/Alert.php @@ -23,13 +23,13 @@ class Alert extends \yii\bootstrap\Alert private $_doNotRender = false; public function init() { - if ($this->body = \Yii::$app->getSession()->getFlash('error')) { + if ($this->body = \Yii::$app->getSession()->getFlash('error', null, true)) { Html::addCssClass($this->options, 'alert-danger'); - } elseif ($this->body = \Yii::$app->getSession()->getFlash('success')) { + } elseif ($this->body = \Yii::$app->getSession()->getFlash('success', null, true)) { Html::addCssClass($this->options, 'alert-success'); - } elseif ($this->body = \Yii::$app->getSession()->getFlash('info')) { + } elseif ($this->body = \Yii::$app->getSession()->getFlash('info', null, true)) { Html::addCssClass($this->options, 'alert-info'); - } elseif ($this->body = \Yii::$app->getSession()->getFlash('warning')) { + } elseif ($this->body = \Yii::$app->getSession()->getFlash('warning', null, true)) { Html::addCssClass($this->options, 'alert-warning'); } else { $this->_doNotRender = true;