Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Applying parameterized roles to Catalyst controllers

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


oliver.g.charles at googlemail

Jan 8, 2010, 9:58 AM

Post #1 of 2 (616 views)
Permalink
Applying parameterized roles to Catalyst controllers

Hi,

I've asked this question a few times, but never got far enough to
actually solve the problem. So, instead of asking on IRC again and
losing the logs/forgetting stuff, I'm going to try here!

I have a role that needs to be parameterized before it is applied to
my controller. However, Catalyst controllers seem to require that all
methods consume the MooseX::MethodAttributes role meta.
MooseX::Role::Parameterized doesn't seem to allow me to apply another
metaclass or traits.

So, does anyone have any way I might go about doing this? I thought
about patching MX::R::P to allow me to specific extra traits, like
Moose::Role. That would give something like~

use MooseX::Role::Parameterized -traits => [
'MooseX::MethodAttributes::Meta::Role' ]

--
Oliver Charles / aCiD2

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


oliver.g.charles at googlemail

Jan 8, 2010, 10:05 AM

Post #2 of 2 (567 views)
Permalink
Re: Applying parameterized roles to Catalyst controllers [In reply to]

ERROR: RETARD AT COMPUTER.

Turns out this is *exactly* possible at the moment:

http://github.com/bobtfish/moosex-methodattributes/blob/master/t/param_role.t

Sigh, I feel a little bit dumb now

--
Oliver Charles / aCiD2

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.