PHP Класс 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']);
Автор: Christoph Erdmann ([email protected])
Наследование: extends macgyer\yii2materializecss\lib\BaseWidget
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$alertLevels custom alert levels
$options the HTML attributes for the widget container tag.

Защищенные свойства (Protected)

Свойство Тип Описание
$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]]

Открытые методы

Метод Описание
init ( ) Initializes the widget.
run ( ) : string Executes the widget.

Приватные методы

Метод Описание
renderHtml ( string $message, array $options = [] ) : string Renders a single flash message.

Описание методов

init() публичный Метод

Initializes the widget.
public init ( )

run() публичный Метод

Executes the widget.
public run ( ) : string
Результат string the result of widget execution to be outputted.

Описание свойств

$alertLevels публичное свойство

custom alert levels
public $alertLevels

$options публичное свойство

the HTML attributes for the widget container tag.
См. также: [yii\helpers\BaseHtml::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $options

$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]]
protected $predefinedAlertLevels