https://github.com/polettix/dancer-plugin-flashnote
support notifications in your Dancer applications
https://github.com/polettix/dancer-plugin-flashnote
Last synced: 6 months ago
JSON representation
support notifications in your Dancer applications
- Host: GitHub
- URL: https://github.com/polettix/dancer-plugin-flashnote
- Owner: polettix
- Created: 2011-02-13T06:21:25.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2012-09-22T22:00:21.000Z (over 12 years ago)
- Last Synced: 2024-10-27T12:33:02.526Z (7 months ago)
- Language: Perl
- Homepage:
- Size: 870 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
NAME
====Dancer::Plugin::FlashNote - support notifications in your Dancer web
applicationSYNOPSIS
========# In the configuration you choose a "flash style", e.g.
# notifications stored in an array and automatically
# removed from the session when used
plugins:
FlashNote:
queue: multiple
dequeue: when_used# In the application you generate flash notifications
package MyWebService;use Dancer;
use Dancer::Plugin::FlashNote;get '/hello/:id/:who' => sub {
flash 'A first error message'
unless params->{id} =~ /\A\d+\z/mxs;
flash 'A second error message'
unless params->{who} =~ /\A(?: you | me )\z/mxs;
# ...
template 'index';
};# Then, in the layout you consume them and they are flushed
<% IF flash %>
- <% notice | html %>
<% FOR notice = flash %>
<% END %>
<% END %>
ALL THE REST
============
Want to know more? [See the module’s documentation](http://search.cpan.org/perldoc?Dancer::Plugin::FlashNote) to figure out
all the bells and whistles of this module!
Want to install the latest release? [Go fetch it on CPAN](http://search.cpan.org/dist/Dancer-Plugin-FlashNote/).
Want to contribute? [Fork it on GitHub](https://github.com/polettix/Dancer-Plugin-FlashNote).
That’s all folks!