[Catalyst] Applying roles that contain actions.

Bill Moseley moseley at hank.org
Sat Sep 8 04:33:47 GMT 2012

On Fri, Sep 7, 2012 at 11:50 AM, Tomas Doran <bobtfish at bobtfish.net> wrote:

> On 5 Sep 2012, at 21:48, Bill Moseley wrote:
> >
> > Currently I just manually apply the role directly in the existing
> controller, so not a huge issue, but would be handy if I could just add a
> role to the base class and pull in all the components
> What's stopping you doing this?

Sorry, I wasn't very clear in that sentence.   It's a bit more involved
than this, but I'm looking at applying a controller role (one with actions)
dynamically.   So, the code ends up something like:

package MyApp;

after setup_components =3D> sub {

my $self =3D shift;
my $controller $self->controller( 'Foo' );
use My::Role::With::Actions;
My::Role::With::Actions->meta->apply( $controller );

Results in:

Composing MooseX::MethodAttributes::Role::Meta::Role::Application onto
instances is unsupported

That makes sense to me -- for one thing Catalyst would not know about the
actions in the role.

-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120907/adad8=

More information about the Catalyst mailing list