PHP Class macgyer\yii2materializecss\widgets\Alert
All flash messages are displayed in the sequence they were assigned using
yii\web\Session::setFlash()-detail).
You can set messages as follows:
php
Yii::$app->session->setFlash('error', 'This is the message');
Yii::$app->session->setFlash('success', 'This is the message');
Yii::$app->session->setFlash('info', 'This is the message');
Multiple messages can be set by specifying an array:
php
Yii::$app->session->setFlash('error', ['Error 1', 'Error 2']);
Mostrar archivo
Open project: macgyer/yii2-materializecss
Class Usage Examples
Public Properties
Property |
Type |
Description |
|
$alertLevels |
|
custom alert levels |
|
$options |
|
the HTML attributes for the widget container tag. |
|
Protected Properties
Property |
Type |
Description |
|
$predefinedAlertLevels |
|
the default alert levels.
This array is setup as $key => $value, where:
- $key is the name of the session flash variable
- $value is the alert type (will be uses as CSS class)
To define own alert levels and their corresponding CSS classes or to overrride the
default levels use [[alertLevels]] |
|
Public Methods
Method |
Description |
|
init ( ) |
Initializes the widget. |
|
run ( ) : string |
Executes the widget. |
|
Private Methods
Method Details
public run ( ) : string |
return |
string |
the result of widget execution to be outputted. |
Property Details
$alertLevels public_oe property
$options public_oe property
the HTML attributes for the widget container tag.
$predefinedAlertLevels protected_oe property
the default alert levels.
This array is setup as $key => $value, where:
- $key is the name of the session flash variable
- $value is the alert type (will be uses as CSS class)
To define own alert levels and their corresponding CSS classes or to overrride the
default levels use [[alertLevels]]
protected $predefinedAlertLevels |