[Catalyst-dev] question about Catalyst::Manual::Actions
John Napiorkowski
jjn1056 at yahoo.com
Fri Jul 7 12:04:08 CEST 2006
Hi,
This actions section is a great addition and I see immediate uses for it. However I have a question about the docs. It gives and example of a BEFORE action:
#--------------------------------------#
package Catalyst::Action::SayBefore;
use base 'Catalyst::Action';
sub execute {
my $self = shift;
my ( $controller, $c, $test ) = @_;
$c->stash->{what} = 'world';
$self->NEXT::execute( @_ );
};
1;
#--------------------------------------#
Would an AFTER action look like this?
#--------------------------------------#
package Catalyst::Action::SayBefore;
use base 'Catalyst::Action';
sub execute {
my $self = shift;
my ( $controller, $c, $test ) = $self->NEXT::execute( @_ );
## Anything you want to do after the action runs
## but before it continues.
};
1;
#--------------------------------------#
If I have this right is there still time for me to submit a docs patch? I found I read it
few times before I grasped that I could do an after action. I think it work clarify
things a bit. I really see the possibility that there will be a whole host of contributed
actions on this model.
--john
More information about the Catalyst-dev
mailing list