How can we set a flash message in yii2?
Answer / Kumud Singh
In Yii2, you can set a flash message using the $this->session or Yii::$app->session. Here's an example:
```php
Yii::$app->session->setFlash('success', 'Your message here.');
```
| Is This Answer Correct ? | 0 Yes | 0 No |
How to enable the pretty url format in yii2?
How to get current url in yii?
What is widgets in yii? How we can use it?
What is gii in yii 2.0?
How to get current action id in yii ?
What are components in yii 2?
What is difference between “render” and “renderpartial” in yii?
How we can get current controller & action name in yii?
What are the new features acquired in yii2?
How to install yii framework?
What is the latest version of yii?
Why yii is the best framework?