[Catalyst] how to excute not only one 'begin' or 'end'?

Yuval Kogman nothingmuch at woobling.org
Wed May 3 13:09:46 CEST 2006


On Tue, May 02, 2006 at 21:41:53 +0200, T. H. Lin wrote:

> is it possible to have action in this way?
...

You can override Controller::A::B's methods, as inherited from
Catalyst::Base.

Currently _END does this:

sub _END : Private {
    my ( $self, $c ) = @_;
    my $end = ( $c->get_actions( 'end', $c->namespace ) )[-1];
    return 1 unless $end;
    $end->execute($c);
    return !@{ $c->error };
}

Do do what you want it should look more like _AUTO in
Catalyst::Base, or you could override _DISPATCH entirely to modify
the dispatch procedure. _END only uses the last element of the
get_actions list, while _AUTO executes the entire list.

Contact mst or nothingmuch (me) on IRC for explanation.


Note that this will probably be wiser if done with "custom" names -
new staff on the project will be less confused if they see something
new, than if they see something they think they know but that
behaves in a different way.

-- 
  Yuval Kogman <nothingmuch at woobling.org>
http://nothingmuch.woobling.org  0xEBD27418

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060503/bcc8622a/attachment.pgp 


More information about the Catalyst mailing list