abushamleh/yii2-toast
Composer 安装命令:
composer require abushamleh/yii2-toast
包简介
Yii2 toast alert
README 文档
README
Run the Composer command to install the latest version:
composer require abushamleh/yii2-toast "dev-master"
Usage
ToastAlert
use abushamleh\toast\ToastAlert; echo ToastAlert::widget([ 'options' => [], 'heading' => 'heading', 'text' => 'text', 'type' => 'type', ]);
ToastBlock
ToastBlock widget renders a message from session flash. All flash messages are displayed in the sequence they were assigned using setFlash.
use abushamleh\toast\ToastBlock; //You can set message as following: 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'); Yii::$app->session->setFlash('info', ['heading' => 'Message title' 'text' => 'This is the message']); //Multiple messages could be set as follows: Yii::$app->session->setFlash('error', ['Error 1', 'Error 2']); Yii::$app->session->setFlash('error', [['heading' => 'Message title' 'text' => 'This is the message'], 'Error 2']); echo ToastBlock::widget([ 'options' => [] ]);
统计信息
- 总下载量: 4.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-04