Skip to content

derekisbusy/yii2-flash-growl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Growl Flash Messages

Packagist Packagist

Widget to output flash messages as growls.

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist derekisbusy/yii2-flash-growl "1.*"

or add

"derekisbusy/yii2-flash-growl": "1.*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

// 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');