[Catalyst] Catalyst has a Moose now :)

Daniel McBrearty danielmcbrearty at gmail.com
Wed Apr 12 10:33:03 CEST 2006


until someone mentioned they were crop circles, I thought the catalyst
animal was an amoeba ;-)

On 4/12/06, Sebastian Riedel <sri at oook.de> wrote:
>
> Yes, everybody has a pony, but we have a Moose!
>
> Today we've implemented reusable actions, but instead of plain old
> method overloading we've chosen Moose roles. ;)
> And here are two simple examples:
>
> 1.
>      package MyApp::Controller::Foo;
>      use base 'Catalyst::Controller';
>      sub bar : Global : Action('XMLRPC') {}
>      1;
>
>      package Catalyst::Action::XMLRPC;
>      use Moose::Role;
>      before 'execute' => sub {
>          my ( $self, $controller, $c ) = @_;
>          $c->xmlrpc;
>      }
>      1;
>
>
> 2.
>      package MyApp::Controller::Foo;
>      use base 'Catalyst::Controller';
>      sub bar : Global : Action('+MyApp::Action::Test') {
>          my ( $self, $c, @args ) = @_;
>          $c->stash->{foo} = 23;
>      }
>      1;
>
>      package MyApp::Action::Test;
>      use Moose::Role;
>      after 'execute' => sub {
>          my ( $self, $controller, $c, @args ) = @_;
>          $c->res->body( $c->stash->{foo} . join '', @args );
>      }
>      1;
>
>
> For more informations about Moose see the following links:
>
>      http://cpansearch.perl.org/dist/Moose/lib/Moose.pm
>      http://cpansearch.perl.org/~stevan/Moose/lib/Moose/Cookbook.pod
>
>
> This is a feature for *advanced* Catalyst developers, so don't be
> afraid if you don't understand it yet.
>
>
> --
> sebastian
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>



--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060412/d3adf297/attachment-0001.htm 


More information about the Catalyst mailing list