1 package SL::Helper::Flash;
6 our @ISA = qw(Exporter);
7 our @EXPORT = qw(flash render_flash);
11 $category = 'info' if $category eq 'information';
13 $::form->{FLASH} ||= { };
14 $::form->{FLASH}->{ $category } ||= [ ];
15 push @{ $::form->{FLASH}->{ $category } }, @_;
19 return $::form->parse_html_template('common/flash');
28 SL::Helpers::Flash - helper functions for storing messages to be
33 The flash is a store for messages that should be displayed to the
34 user. Each message has a category which is usually C<information>,
35 C<warning> or C<error>. The messages in each category are grouped and
36 displayed in colors appropriate for their severity (e.g. errors in
39 Messages are rendered either by calling the function C<render_flash>
40 or by including the flash sub-template from a template with the
43 [%- INCLUDE 'common/flash.html' %]
49 =item C<flash $category, $message>
51 Stores a message for the given category. The category can be either
52 C<information>, C<warning> or C<error>. C<info> can also be used as an
53 alias for C<information>.
57 Outputs the flash message by parsing the C<common/flash.html> template
64 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>