Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

documentation

  • Loading branch information...
commit b871af1542f139476ea51aa8254537e35a176468 1 parent e4e93da
@dams authored
Showing with 21 additions and 11 deletions.
  1. +21 −11 README.pod
View
32 README.pod
@@ -42,8 +42,8 @@ message will be displayed. But that's not too hard (see L<SYNOPSYS>).
Basically, the plugin gives you access to the 'flash' hash in your views. It
can be used to display flash messages.
-By default, the plugin works using a descent default configuration. However,
-you can change the behaviour of the plugin. See L<CONFIGURATION>
+By default, the plugin works using a decent configuration. However, you can
+change the behaviour of the plugin. See L<CONFIGURATION>
=head1 METHODS
@@ -59,18 +59,28 @@ This method can take 1 or 2 parameters. When called with two parameters, it
sets the flash message for the given key.
When called with one parameter, it returns the value of the flash message of
-the given key, and also deletes this entry.
+the given key. The message is deleted from the flash hash in the session.
In both cases, C<flash> always returns the value;
-=head1 CONFIGURATION
+=head1 IN YOUR TEMPLATE
+
+After having set a flash message using C<flash> in your Dancer route, you can
+access the flash message from within your template. The plugin provides you
+with the C<flash> hashref, that you can access in your template, for example
+like this :
+
+ <div class=error> <% flash.error %> </div>
-=head2 no configuration
+When you use it in your template, the flash message is deleted. So next
+time, C<flash.error> will not exist.
+
+=head1 CONFIGURATION
With no configuration whatsoever, the plugin will work fine, thus contributing
to the I<keep it simple> motto of Dancer.
-=head2 configuration default
+=head2 configuration default values
These are the default values. See below for a description of the keys
@@ -86,20 +96,20 @@ These are the default values. See below for a description of the keys
=item token_name
The name of the template token that will contain the hash of flash messages.
-Default : flash
+B<Default> : C<flash>
=item session_hash_key
You probably don't need that, but this setting allows you to change the name of
the session key used to store the hash of flash messages. It may be useful in
-the unlikely case where you have key name conflicts in your session. Default :
-_flash
+the unlikely case where you have key name conflicts in your session. B<Default> :
+C<_flash>
=back
=head1 COPYRIGHT
-This software is copyright (c) 2011 by Damien "dams" Krotkine.
+This software is copyright (c) 2011 by Damien "dams" Krotkine <dams@cpan.org>.
=head1 LICENCE
@@ -108,7 +118,7 @@ the same terms as the Perl 5 programming language system itself.
=head1 AUTHORS
-This module has been written by Damien Krotkine <dams@cpan.org>.
+This module has been written by Damien "dams" Krotkine <dams@cpan.org>.
=head1 SEE ALSO

0 comments on commit b871af1

Please sign in to comment.
Something went wrong with that request. Please try again.