Hi,

I wrote a patch that permits to use multiple ActionClass attributes in a
controller action.
Here is the synopsys:

=head1 USING MULTIPLE ACTIONS

To use multiple actions you just need to had more ActionClass
attributes:

 sub Hello :Local :ActionClass('SayBefore') ActionClass('SayAfter') {
   $c->res->output( 'Hello '.$c->stash->{what} );
 }

Attention that if you are using multiple actions you probably want to
use Class::C3 dispatch order. With NEXT just the first ActionClass will
be called. Here you have an example:

 package Catalyst::Action::SayBefore;
 use Class::C3;
 use base 'Catalyst::Action';

 sub execute {
   my $self = shift;
   my ( $controller, $c, $test ) = @_;
   $c->stash->{what} = 'world';
   $self->next::method( @_ );
 };

 1;

 package Catalyst::Action::SayAfter;
 use Class::C3;
 use base 'Catalyst::Action';

 sub execute {
   my $self = shift;
   my ( $controller, $c, $test ) = @_;
   $self->next::method( @_ );
   $c->res->output( 'Bye '.$c->stash->{what} );
 };

 1;

Patch with tests and docs attached.

Attachment: catalyst_multiple_action_classes.diff
Description: Binary data

Attachment: documentation.diff
Description: Binary data

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to