sfFlashMessagePlugin
2.0.0stable
for sf 1.4sf 1.3sf 1.2 MIT
sfFlashMessagePlugin
Description
This helper plugin displays user flash messages using jQueryNotifyBar or jquery-notice plugin (your choice).
First method displays very nice looking notify bar which pops from the top and disappear after defined amount of time.
Second method displays growl-like messages at the right side of the browser window.
Customization is possible.
This plugin uses awesome jQuery library, jqueryNotifyBar plugin by Dmitri Smirnov and jquery-notice plugin by
Tim Benniks
Try out demonstration - method one |
Try out demonstration - method two
Developers
| Name |
Status |
Email |
Artur Rozek |
lead |
lp.ten.traofni <<ta>> rutra
|
License
Copyright (c) 2009 Artur Rozek - artur(at)infoart.net.pl
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
sfFlashMessagePlugin
Description
This helper plugin displays user flash messages using jQueryNotifyBar or jquery-notice plugin (your choice).
First method displays very nice looking notify bar which pops from the top and disappear after defined amount of time.
Second method displays growl-like messages at the right side of the browser window.
Customization is possible.
This plugin uses awesome jQuery library, jqueryNotifyBar plugin by Dmitri Smirnov and jquery-notice plugin by
Tim Benniks
Try out demonstration - method one |
Try out demonstration - method two
Requirements
This plugin requires JqueryReloadedPlugin.
Installation
$ symfony plugin:install sfFlashMessagePlugin
$ symfony cache:clear
Usage
Place jquery helper in your layout or template (or settings.yml):
<?php use_helper("jQuery") ?>
And inside body tag place FlashMessage helper:
<?php use_helper("sfFlashMessage") ?>
Define flash message in your actions.class.php
$this->getUser()->setFlash('notice', 'This is notice');
Above will display green notice with 'This is notice' text.
If there is no flash message defined for the user, nothing will be displayed.
Customizations
Possible types of flash messages are:
$this->getUser()->setFlash('success', 'This is success'); //green color
$this->getUser()->setFlash('notice', 'This is notice'); //yellow color
$this->getUser()->setFlash('warning', 'This is warning'); //orange color
$this->getUser()->setFlash('error', 'This is error'); //red color
In your app.yml file:
sf_flash_message:
delay: 2500 #delay time after which notice disappear (in miliseconds)
#error and warning messages displays twice as long as notice and success messages
method: growl #pop - use jQueryNotifyBar plugin (pops notice from the top),
#growl - use jquery-notice plugin (displays growl-like notice on the right side without interference to each other)
You can also customize look and feel of notify bars by defining your own css. (See css plugin dir).