Skip to content

saltyduck/Amon2-Plugin-Web-Flash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

Amon2::Plugin::Web::Flash - Ruby on Rails flash for Amon2

SYNOPSIS

# In your Web.pm
__PACKAGE__->load_plugins(
     'Web::Flash', # must be loaded *BEFORE* HTTP Session
     'Web::HTTPSession',
);

# In your controller
$c->flash(success => 'ok'); # Set a data exposed in the next request

# At the controller of the next request
$c->flash('success') # You got 'ok'

DESCRIPTION

This plugin provides a way to pass data between request. Anything placed in flash is exposed in the next request and then deleted.

This is a clone of Ruby on Rails flash.

METHODS

flash

$c->flash(key => 'value'); # set
$c->flash('key') # get
my $hashref = $c->flash; # get all key-value pair

The data you set can be retrieved during the processing of the next request.

flash_now

$c->flash_now(key => 'value');

Unlike flash, the set data can be retrieved during the processing of the current request.

flash_keep

$c->flash_keep('key'); # keep the data of the specified key
$c->flash_keep; # keeps all

Keep either a specific flash data or all current flash data available for the next request.

flash_discard

$c->flash_discard('key');
$c->flash_discard; # discard all

Delete the flash data set in the current request.

AUTHOR

Yoshimasa Ueno

COPYRIGHT

Copyright 2014- Yoshimasa Ueno

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

NO WARRANTY

This software is provided "as-is," without any express or implied warranty. In no event shall the author be held liable for any damages arising from the use of the software.

SEE ALSO

Amon2

About

Rails flash for Amon2

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages