mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-04 22:57:40 +08:00
Added Alert component example
Flash message example with Alert bootstrap component. close #8311
This commit is contained in:
committed by
Carsten Brandt
parent
0b3e139dc3
commit
3c45f140f0
@ -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
|
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.
|
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>
|
## Cookies <span id="cookies"></span>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user