From: John Napiorkowski Date: Tue, 19 Jan 2010 15:52:49 +0000 (+0000) Subject: tweaked docs based on IRC suggestions X-Git-Tag: 5.80019~13^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=cea3f28ab5be5ba72557325c49fe684eb18e627d tweaked docs based on IRC suggestions --- diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index ee39c7b..c738f9e 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -448,32 +448,20 @@ Sets 'path_prefix', as described below. =head2 action_args -Allows you to set instantiation arguments on your custom Actions or ActionRoles. -You can set args globally (shared across all actions) and specifically (for a -single action). - - package MyApp::Web::Controller::MyController; - use parent 'Catalyst::Controller'; +Allows you to set constructor arguments on your Actions or ActionRoles. You can +set args globally (all actions of the controller) and specifically (for a single +action). __PACKAGE__->config({ action_args => { '*' => {globalarg1=>'hello', globalarg2=>'goodbye'}, 'specific_action' => {customarg=>'arg1'}, - }, + }, }); - - sub specific_action :Path('') ActionClass('CustomActionClass') {} - - 1; - -In the case above, your 'CustomActionClass' would get passed the following -arguments when it is instantiated: (globalarg1=>'hello', globalarg2=>'goodbye', -'customarg=>'arg1'). Please note that the order the arguments are passed are not -certain to be in the order declared. - -As with all other configuration hashes, you can set values inline with your -controller (as above) or centrally via a configuration file (such as you might -use with the ConfigLoader plugin). + +In the case above the action class associated with 'specific_action' would get +passed the following arguments when it is instantiated: (globalarg1=>'hello', +globalarg2=>'goodbye', 'customarg=>'arg1'). =head1 METHODS