Add doc for no-args call to ->uri_for
Alastair McGowan-Douglas [Fri, 6 Nov 2009 17:09:51 +0000 (17:09 +0000)]
Changes
lib/Catalyst.pm

diff --git a/Changes b/Changes
index abd8df6..ae54fce 100644 (file)
--- a/Changes
+++ b/Changes
@@ -12,6 +12,9 @@
     - Require HTTP::Request 5.814 and HTTP::Response 5.813 from LWP 5.814
       to avoid test fails.
 
+  Documentation:
+    - Document no-args call to $c->uri_for.
+
   New features:
     - Added disable_component_resolution_regex_fallback config option to
       switch off (deprecated) regex fallback for component resolution.
index 7030930..94b0c85 100644 (file)
@@ -1198,7 +1198,7 @@ sub setup_finalize {
     $class->setup_finished(1);
 }
 
-=head2 $c->uri_for( $path, @args?, \%query_values? )
+=head2 $c->uri_for( $path?, @args?, \%query_values? )
 
 =head2 $c->uri_for( $action, \@captures?, @args?, \%query_values? )
 
@@ -1206,6 +1206,11 @@ Constructs an absolute L<URI> object based on the application root, the
 provided path, and the additional arguments and query parameters provided.
 When used as a string, provides a textual URI.
 
+If no arguments are provided, the URI for the current action is returned.
+To return the current action and also provide @args, use
+C<< $c->uri_for( $c->action, @args ) >>. Don't do 
+C<< $c->uri_for( undef, @args ) >>.
+
 If the first argument is a string, it is taken as a public URI path relative
 to C<< $c->namespace >> (if it doesn't begin with a forward slash) or
 relative to the application root (if it does). It is then merged with