Dancer2-Plugin-FlashNote
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/FlashNote.pm view on Meta::CPAN
]
=item B<< array >>
this always set the array mode, i.e. you get an array also when there is only
one parameter. This is probably your best choice if you plan to use multiple
parameters, because you always get the same structure in the template:
flash => [
[ 'whatever' ],
[ 'hey', 'you!' ],
]
=back
The default handling style is I<auto>.
=head2 Dequeueing Styles
When you put a message in the queue, it is kept in the User's session until it
is eventually dequeued. You can control how the message is deleted from the
session with the C<dequeue> parameter, with the following possibilities:
=over
=item B<< never >>
items are never deleted automatically, but they will be flushed in the code
by calling C<flash_flush()>;
=item B<< always >>
items are always deleted from the session within the same call. Technically
speaking, using the session in this case is a bit overkill, because the session
is only used as a mean to pass data from the code to the template;
=item B<< when_used >>
items are all deleted when any of them is used in some way from the template. The
underlying semantics here is that if you get the chance to show a flash message
in the template, you can show them all so they are removed from the session. If
for some reason you don't get this chance (e.g. because you are returning a
redirection, and the template rendering will happen in the next call) the
messages are kept in the session so that you can display them at the next
call that actually makes use of a template;
=item B<< by_key >>
this style only applies if the queueing style is either C<key_single> or C<key_multiple>.
It is an extension of the C<when_used> case, but only used keys are deleted and
the unused ones are kept in the session for usage at some later call.
=back
The default dequeuing style is I<when_used>.
=head1 DEPENDENCIES
L<Dancer2>
=head1 BUGS AND LIMITATIONS
Curious about active bugs or want to report one? The bug tracking system
can be found at L<https://rt.cpan.org/Public/Dist/Display.html?Name=Dancer2-Plugin-FlashNote>.
=head1 SEE ALSO
If you want to contribute, check this module out in GitHub at
L<https://github.com/smith153/Dancer2-Plugin-FlashNote>.
This module is a conversion from the original L<Dancer::Plugin::FlashNote> by Flavio Poletti
If you find a bug in L<Dancer2::Plugin::FlashNote>, it may very likely be in
L<Dancer::Plugin::FlashNote> as well.
=head1 AUTHOR
Samuel Smith <esaym@cpan.org>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2017 by Samuel Smith esaym@cpan.org.
This module is free software. You can redistribute it and/or
modify it under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.
=cut
__END__
( run in 1.059 second using v1.01-cache-2.11-cpan-39bf76dae61 )