Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

support notifications in your Dancer applications

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 Changes
Octocat-spinner-32 LEGAL
Octocat-spinner-32 README.md
Octocat-spinner-32 dist.ini
README.md

NAME

Dancer::Plugin::FlashNote - support notifications in your Dancer web application

SYNOPSIS

# 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 %>
   <ul class="error">
   <% FOR notice = flash %>
      <li><% notice | html %></li>
   <% END %>
   </ul>
<% END %>

ALL THE REST

Want to know more? See the module’s documentation to figure out all the bells and whistles of this module!

Want to install the latest release? Go fetch it on CPAN.

Want to contribute? Fork it on GitHub.

That’s all folks!

Something went wrong with that request. Please try again.