CatalystX::Usul::Plugin::Controller::PersistentState - Set/Get state information on/from the session store
Describes v0.17.$Rev: 1 $
package YourApp::Controller::YourController; use CatalystX::Usul::Moose; extends q(CatalystX::Controller); with q(CatalystX::Usul::TraitFor::Controller::PersistentState);
Uses the session store to provide uri arguments and parameters that are persistent across requests
@args = $self->get_uri_args( $c );
Each action can define a list of named arguments in config. This method returns a list of values, one for each defined argument. Values are searched for in the following locations; the uri attribute cache, the request object, the session and finally the configuration default
$params = $self->get_uri_query_params( $c );
Each action can define a list of key / value parameter pairs in config. This method return a hash ref of parameters. Values are searched for in the same locations as "get_uri_args"
$self->init_uri_attrs( $c, $model_class );
This needs to be called early in chained controller methods. It initialises the attribute cache used by the other method calls
When the role is applied $self-can( q(persist_state) )> is true
$self-
$self->set_uri_args( $c, @args );
Saves the supplied list of arguments to the session and the cache
$self->set_uri_attrs_or_redirect( $c, @args );
If at least one defined argument is passed then this method calls "set_uri_args" and "set_uri_query_params" and the returns. If no defined arguments are passed it calls "get_uri_args" and "get_uri_query_params". This method then creates a uri using these values and redirects to it
$self->set_uri_query_params( $c, \%params );
Saves the supplied parameter hash to the session and the cache
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <Support at RoxSoft.co.uk>
<Support at RoxSoft.co.uk>
Copyright (c) 2014 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install CatalystX::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::Usul
CPAN shell
perl -MCPAN -e shell install CatalystX::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.