octicon-rss(16/)
You've already forked yii2
mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 23:50:38 +08:00
Added Alert component example
Flash message example with Alert bootstrap component. close #8311
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
committed by
Carsten Brandt
gitea-unlock(16/)
parent
0b3e139dc3
commit
3c45f140f0
octicon-diff(16/tw-mr-1) 1 changed files with 9 additions and 0 deletions
@@ -230,6 +230,15 @@ $alerts = $session->getFlash('alerts');
|
||||
find sometimes you are getting an array while sometimes you are getting a string, depending on the order of
|
||||
the invocation of these two methods.
|
||||
|
||||
> Tip: For displaying Flash messages you can use [[yii\bootstrap\Alert|bootstrap Alert]] widget in the following way:
|
||||
>
|
||||
> ```php
|
||||
> echo Alert::widget([
|
||||
> 'options' => ['class' => 'alert-info'],
|
||||
> 'body' => Yii::$app->session->getFlash('postDeleted'),
|
||||
> ]);
|
||||
> ```
|
||||
|
||||
|
||||
## Cookies <span id="cookies"></span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user