Growl Flash Messages
, (*1)
Widget to output flash messages as growls., (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
composer require --prefer-dist derekisbusy/yii2-flash-growl "1.*"
or add, (*5)
"derekisbusy/yii2-flash-growl": "1.*"
to the require section of your composer.json
file., (*6)
Usage
Once the extension is installed, simply use it in your code by :, (*7)
// 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');