From: Tomas Doran Date: Wed, 10 Sep 2008 15:15:29 +0000 (+0000) Subject: Additional doc for uri_for to illustrate passing an action and captures (jhannah) X-Git-Tag: 5.8000_03~61 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=9df7c5d97e0b93b4c896265cc7b9e78801328466 Additional doc for uri_for to illustrate passing an action and captures (jhannah) --- diff --git a/Changes b/Changes index 5dafda1..2a10932 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,8 @@ - Added test for component instances getting $self->{value} from config. - Add Catalyst::Response->print() method (ilmari) - Optionally aggregate tests using Test::Aggregate (Florian Ragwitz). + - Additional docs for uri_for to mention how to use $c->action and + $c->req->captures (jhannah) 5.7XXXXXX XXXX - Fix some Win32 test failures diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index bfbf763..a09747a 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1011,6 +1011,15 @@ C<< $c->dispatcher->uri_for_action >>; if the first element of C<@args> is an arrayref it is treated as a list of captures to be passed to C. +You can maintain the arguments captured by an action (e.g.: Regex, Chained) +using C<< $c->req->captures >>. + + # For the current action + $c->uri_for($c->action, $c->req->captures); + + # For the Foo action in the Bar controller + $c->uri_for($c->controller->('Bar')->action_for('Foo'), $c->req->captures); + =cut sub uri_for {