X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=23a5ea961c788b6ec0cd50001a7ce247222d13ab;hp=a09747a1408c7f7655c8da001628a3d156898c9a;hb=ae0e35ee6dd51e78c0ffc2457699beadc7eefab8;hpb=88eee38e25dd1a991008fb5f61b848fcecb97ad0 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index a09747a..23a5ea9 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -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, but does a full dispatch, instead of just +calling the new C<$action> / C<$class-E$method>. This means that C, +C and the method you go to are called, just like a new request. + +C<$c-Estash> is kept unchanged. + +In effect, C allows you to "wrap" another action, just as it +would have been called by dispatching from a URL, while the analogous +C 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, but does a full dispatch, instead of just -calling the new C<$action> / C<$class-E$method>. This means that C, -C and the method you go to is called, just like a new request. +Almost the same as C, but does a full dispatch like C, +instead of just calling the new C<$action> / +C<$class-E$method>. This means that C, C and the +method you visit are called, just like a new request. C<$c-Estash> is kept unchanged.