Mojolicious::Plugin::UserMessages - Mojolicious Plugin to manage user message queue(s)
# Mojolicious Lite plugin 'UserMessages' # Mojolicious $self->plugin('UserMessages') # In your code add some messages to the user $self->user_messages( info => 'Just some information' ); $self->user_messages( success => 'Operation completed' ); # In your template get and print the messages # The messages will stay in the queue until you show them # to the user % for my $message ( user_messages->get ) { <div><%= $message->type %> : <%= $message->message %></div> % } # You can also get messages from a specific type % for my $message ( user_messages->get_info ) { <div>INFO : <%= $message->message %></div> % }
Mojolicous::Plugin::UserMessages implements a message queue to the user.
Mojolicious, Mojolicious::Plugin, Mojolicious::Lite
Copyright 2013 Bruno Tavares. All right reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojolicious::Plugin::UserMessages, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::UserMessages
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::UserMessages
For more information on module installation, please visit the detailed CPAN module installation guide.