Flash is a modest widget that allows you to render web user flash messages easily.
A newer version of this extension, TbAlert, is now part of my Bootstrap extension.
To set up the widget you simply need to download the extension, place it in your application's extensions folder (create it under protected if it doesn't exist).
Rendering the widget is easy, you need to add the following code snippet to your main layout (Assuming you placed the extensions under /protected/extensions/flash) :
$this->widget('application.extensions.flash.Flash', array( 'keys'=>array('success','error'), 'htmlOptions'=>array('class'=>'flash'), )); <!-- flashes -->
After you've configured the widget it will display your flash messages.
Total 7 comments
BootFlash has evolved to TbAlert which is a part of the Bootstrap extension.
Hey All,
A newer version of this extension, BootFlash, is now part of my Bootstrap extension.
Bootstrap can be found here: http://www.yiiframework.com/extension/bootstrap/
Does this extension work out of the box with AJAX flash messages? For example, deleting something in a cGridView.
hi Chris83,
but, I put this widget in my main.php, so it became my main notification both success and error...
You need to set the correct category when setting the flash message and then configure yii-flash to display that category. By default the error category is called 'error'.
very nice extension.. thank you Chris83 for the nice extension. Help me so much.. but just curious, how about to show error message with the different class?.. i still using the default blueprint css, it use different class for success and error...
Understood what this extension is intended for as soon as I saw your example. Nice extension, good job :-)
Leave a comment
Please login to leave your comment.