On Fri, Sep 7, 2012 at 11:50 AM, Tomas Doran <[email protected]> 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 => sub {
my $self = 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
[email protected]
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/