X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FCookbook.pod;h=00e8edae5922a5e5522c56b06710f583ee911aaf;hb=2343e11777834e8785e966f572a3a0a2132c3a89;hp=c9d60338f2f3e136c058450f2241c64cf542bc01;hpb=7c1078a49a3c3f5a23b307395eccfc3c4e5a8b06;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index c9d6033..00e8eda 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -15,13 +15,13 @@ placing a C call in the C action. sub end : Private { my ( $self, $c ) = @_; - die "testing"; + die "forced debug"; } If you're tired of removing and adding this all the time, you can easily add a condition. For example: - die "Testing" if $c->params->{dump_info}; + die "force debug" if $c->req->params->{dump_info}; =head2 Disable statistics @@ -281,6 +281,21 @@ to be. And this is all you need to do. +=head2 Pass-through login (and other actions) + +An easy way of having assorted actions that occur during the processing of +a request that are orthogonal to its actual purpose - logins, silent +commands etc. Provide actions for these, but when they're required for +something else fill e.g. a form variable __login and have a sub begin like so: + +sub begin : Private { + my ($self, $c) = @_; + foreach my $action (qw/login docommand foo bar whatever/) { + if ($c->req->params->{"__${action}"}) { + $c->forward($action); + } + } +} =head2 How to use Catalyst without mod_perl @@ -344,6 +359,14 @@ authentication, authorization, and access check phases. For more information see the FastCGI documentation, the C module and L. +=head1 Forwarding with a parameter + +Sometimes you want to pass along an argument when forward to another +action. This can easily be accomplished like this: + + $c->req->args([qw/arg1 arg2 arg3/]); + $c->forward('/wherever'); + =head1 AUTHOR Sebastian Riedel, C