[Catalyst-commits] r12524 - in Catalyst-Runtime/5.80/trunk: . lib
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Mon Jan 4 20:52:10 GMT 2010
Author: t0m
Date: 2010-01-04 20:52:10 +0000 (Mon, 04 Jan 2010)
New Revision: 12524
Modified:
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
Log:
Doc fix
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2010-01-04 20:25:48 UTC (rev 12523)
+++ Catalyst-Runtime/5.80/trunk/Changes 2010-01-04 20:52:10 UTC (rev 12524)
@@ -1,5 +1,10 @@
# This file documents the revision history for Perl extension Catalyst.
+ Documentation:
+ - Fix docs for ->forward method when passed a class name - this should
+ be a component name (e.g. View::HTML, not a full class name, like
+ MyApp::View::HTML).
+
Bug fixes:
- Remove the erroneous --detach option from Catalyst::Script::FastCGI
- --daemon option to Catalyst::Script::FastCGI is fixed.
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2010-01-04 20:25:48 UTC (rev 12523)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2010-01-04 20:52:10 UTC (rev 12524)
@@ -332,8 +332,8 @@
my $foodata = $c->forward('/foo');
$c->forward('index');
- $c->forward(qw/MyApp::Model::DBIC::Foo do_stuff/);
- $c->forward('MyApp::View::TT');
+ $c->forward(qw/Model::DBIC::Foo do_stuff/);
+ $c->forward('View::TT');
Note that L<< forward|/"$c->forward( $action [, \@arguments ] )" >> implies
an C<< eval { } >> around the call (actually
@@ -348,16 +348,16 @@
your code like this:
$c->forward('foo') || return;
-
+
Another note is that C<< $c->forward >> always returns a scalar because it
actually returns $c->state which operates in a scalar context.
Thus, something like:
return @array;
-
-in an action that is forwarded to is going to return a scalar,
+
+in an action that is forwarded to is going to return a scalar,
i.e. how many items are in that array, which is probably not what you want.
-If you need to return an array then return a reference to it,
+If you need to return an array then return a reference to it,
or stash it like so:
$c->stash->{array} = \@array;
@@ -417,9 +417,9 @@
=head2 $c->go( $class, $method, [, \@captures, \@arguments ] )
-The relationship between C<go> and
+The relationship between C<go> and
L<< visit|/"$c->visit( $action [, \@captures, \@arguments ] )" >> is the same as
-the relationship between
+the relationship between
L<< forward|/"$c->forward( $class, $method, [, \@arguments ] )" >> and
L<< detach|/"$c->detach( $action [, \@arguments ] )" >>. Like C<< $c->visit >>,
C<< $c->go >> will perform a full dispatch on the specified action or method,
@@ -504,7 +504,7 @@
=head2 $c->state
-Contains the return value of the last executed action.
+Contains the return value of the last executed action.
Note that << $c->state >> operates in a scalar context which means that all
values it returns are scalar.
@@ -802,7 +802,7 @@
If Catalyst can't find a component by name, it will fallback to regex
matching by default. To disable this behaviour set
disable_component_resolution_regex_fallback to a true value.
-
+
__PACKAGE__->config( disable_component_resolution_regex_fallback => 1 );
=cut
@@ -1215,7 +1215,7 @@
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 ) >>.
+C<< $c->uri_for( $c->action, @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
More information about the Catalyst-commits
mailing list