Catalyst::TraitFor::Request::Params::Hashed - Access to parameters like name[index] as hashes for Catalyst::Request.
name[index]
Version is 0.03
# # application class # package TestApp; use Moose; use namespace::autoclean; use Catalyst qw/ ......... /; extends 'Catalyst'; use CatalystX::RoleApplicator; __PACKAGE__->apply_request_class_roles(qw/ Catalyst::TraitFor::Request::Params::Hashed /); # # controller class # package TestApp::Controller::Test; ......... # query string was like # site[name1]=100&site[name1]=150&site[name2]=200 my $site = $c->req->hashed_params->{site}; # $site is hashref: # # $site = { # name1 => [100, 150], # name2 => 200, # } .........
You can access hashed_parameters, hashed_query_parameters, hashed_body_parameters to get access to parameters as to hashes. Also you can use hashes_params, hashed_query_params and hashed_body_params as shortcuts. Or, if you too lazy, you can use hparams, hquery_params and hbody_params :)
hashed_parameters
hashed_query_parameters
hashed_body_parameters
hashes_params
hashed_query_params
hashed_body_params
hparams
hquery_params
hbody_params
Note, that this trait gives you read-only version of params, query_params and body_params respectively. Also note, that any change to any of three above <WILL NOT HAVE> any effect to all of hashed*params.
params
query_params
body_params
hashed*params
Write tests.
Catalyst, Catalyst::Request, Catalyst::TraitFor::Request::BrowserDetect
Catalyst::TraitFor::Request::BrowserDetect
Report bugs or feature requests
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-TraitFor-Request-Params-Hashed
http://www.assembla.com/spaces/Catalyst-TraitFor-Request-Params-Hashed/tickets
Git repository
git clone git://git.assembla.com/Catalyst-TraitFor-Request-Params-Hashed.git
Oleg Kostyuk, <cub#cpan.org>
<cub#cpan.org>
Copyright 2009 Oleg Kostyuk.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Catalyst::TraitFor::Request::Params::Hashed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::TraitFor::Request::Params::Hashed
CPAN shell
perl -MCPAN -e shell install Catalyst::TraitFor::Request::Params::Hashed
For more information on module installation, please visit the detailed CPAN module installation guide.