sfFlashMessagePlugin
1.0.1stable
for sf 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 plugin.
Its displays very nice looking notify bar which pops from the top and disappear after defined amount of time.
Customization is possible.
This plugin uses awesome jQuery library and jqueryNotifyBar plugin by Dmitri Smirnov.
Installation
$ symfony plugin:install sfFlashMessagePlugin
$ symfony cache:clear
Usage
Place use_helper in your main layout template:
<?php use_helper("Javascript") ?>
<?php use_helper("sfFlashMessage") ?>
and then place helper itself (anywhere inside the body tag):
<?php echo flash_message() ?>
Define flash message in your ations.class.php
$this->getUser()->setFlash('notice', 'This is notice');
Above will display green popup (pops from the top) with 'This is notice' text. It will disappear after 2.5 seconds.
$this->getUser()->setFlash('error', 'Error !');
Above will display red popup with 'Error !' text. It will disappear after 5 seconds.
If there is no flash message for the user, nothing will be displayed.
Customizations
You can customize delay time after which popup disappear (in miliseconds).
<?php echo flash_message(5000) ?>
Which means 5 seconds. Error messages displays twice as long as notice messages (10 seconds for this example).
You can also customize look and feel of notify bars by defining your own css. (See css plugin dir).
Notes
Plugin works best with sfJQueryReloadedPlugin.
Plugin uses jQuery so its not compatible with sfProtoculousPlugin (which has to be disabled).