derekisbusy / yii2-flash-growl
小部件,用于将所有闪存消息输出为弹窗。
1.0.0
2017-02-25 17:05 UTC
Requires
This package is not auto-updated.
Last update: 2024-09-15 01:40:44 UTC
README
小部件,用于将闪存消息输出为弹窗。
安装
安装此扩展的首选方式是通过 composer。
可以运行
composer require --prefer-dist derekisbusy/yii2-flash-growl "1.*"
或者将以下内容添加到你的 composer.json
文件的 require 部分:
"derekisbusy/yii2-flash-growl": "1.*"
使用方法
扩展安装后,只需在代码中使用它即可。
// add flash messages under category growl... Yii::$app->getSession()->addFlash('growl', [ 'type' => 'success', 'duration' => 1500, 'icon' => 'fa fa-success', 'title' => 'Success!', 'message' => 'Action has been performed.', ]); // Display growls in your view... echo \derekisbusy\growl\FlashGrowlWidget::widget(); // Or render the _growl view in the controller if you only need to render the growls... return $this->renderAjax('@derekisbusy/yii2-growl/_growl');