From: Tomas Doran Date: Sun, 10 Jan 2010 14:22:15 +0000 (+0000) Subject: Apply patch to clarify uri_for action from Octavian Rasnita on list X-Git-Tag: 5.80018~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c9ec25f80489f039512982f9e02527d537412f6e Apply patch to clarify uri_for action from Octavian Rasnita on list --- diff --git a/Changes b/Changes index 31aea74..1be1533 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ # This file documents the revision history for Perl extension Catalyst. + Documentation: + - Clarify that uri_for_action works on private paths, with example. + 5.80017 2010-01-10 02:27:29 Documentation: diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 7cc6ad2..98864ee 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1329,6 +1329,20 @@ $c->uri_for >>. You can also pass in a Catalyst::Action object, in which case it is passed to C<< $c->uri_for >>. +Note that although the path looks like a URI that dispatches to the wanted action, it is not a URI, but an internal path to that action. + +For example, if the action looks like: + + package MyApp::Controller::Users; + + sub lst : Path('the-list') {} + +You can use: + + $c->uri_for_action('/users/lst') + +and it will create the URI /users/the-list. + =back =cut @@ -2944,6 +2958,8 @@ numa: Dan Sully obra: Jesse Vincent +Octavian Rasnita + omega: Andreas Marienborg Oleg Kostyuk