Prepare for dev release
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 38b8fa5..7f0e7d2 100644 (file)
@@ -76,7 +76,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.7099_03';
+our $VERSION = '5.8000_01';
 
 sub import {
     my ( $class, @arguments ) = @_;
@@ -346,13 +346,33 @@ When called with no arguments it escapes the processing chain entirely.
 
 sub detach { my $c = shift; $c->dispatcher->detach( $c, @_ ) }
 
+=head2 $c->visit( $action [, \@arguments ] )
+
+=head2 $c->visit( $class, $method, [, \@arguments ] )
+
+Almost the same as C<forward>, but does a full dispatch, instead of just
+calling the new C<$action> / C<$class-E<gt>$method>. This means that C<begin>,
+C<auto> and the method you go to are called, just like a new request.
+
+C<$c-E<gt>stash> is kept unchanged.
+
+In effect, C<visit> allows you to "wrap" another action, just as it
+would have been called by dispatching from a URL, while the analogous
+C<go> allows you to transfer control to another action as if it had
+been reached directly from a URL.
+
+=cut
+
+sub visit { my $c = shift; $c->dispatcher->visit( $c, @_ ) }
+
 =head2 $c->go( $action [, \@arguments ] )
 
 =head2 $c->go( $class, $method, [, \@arguments ] )
 
-Almost the same as C<detach>, but does a full dispatch, instead of just
-calling the new C<$action> / C<$class-E<gt>$method>. This means that C<begin>,
-C<auto> and the method you go to is called, just like a new request.
+Almost the same as C<detach>, but does a full dispatch like C<visit>,
+instead of just calling the new C<$action> /
+C<$class-E<gt>$method>. This means that C<begin>, C<auto> and the
+method you visit are called, just like a new request.
 
 C<$c-E<gt>stash> is kept unchanged.
 
@@ -1011,6 +1031,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<uri_for_action>.
 
+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 {
@@ -2507,6 +2536,8 @@ omega: Andreas Marienborg
 
 phaylon: Robert Sedlacek <phaylon@dunkelheit.at>
 
+rafl: Florian Ragwitz <rafl@debian.org>
+
 sky: Arthur Bergman
 
 the_jester: Jesse Sheidlower