Permalink
Browse files

updated documentation

  • Loading branch information...
1 parent 7b15ac8 commit bc6540f7d2bdade28f2a6a1f120e4bb870b57465 @dams committed Feb 5, 2011
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/Dancer/Plugin/FlashMessage.pm
@@ -87,7 +87,7 @@ 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 configuration. However, you can
+By default, the plugin works using a decent configuration. However, you can
change the behaviour of the plugin. See L<CONFIGURATION>
=head1 METHODS
@@ -108,6 +108,18 @@ the given key. The message is deleted from the flash hash in the session.
In both cases, C<flash> always returns the value;
+=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>
+
+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

0 comments on commit bc6540f

Please sign in to comment.