[Catalyst] Applying roles that contain actions.

Lukas Thiemeier spamcatcher at thiemeier.net
Fri Sep 7 20:31:25 GMT 2012


My Last years Advent articles might help. It is a introduction to
creating Chained Catalyst actions in Moose::Role(s):

http://www.catalystframework.org/calendar/2011/10
http://www.catalystframework.org/calendar/2011/17

cheers, lukast

On 09/05/2012 10:48 PM, Bill Moseley wrote:
> I've been injecting models into Catalyst apps (either using
> CatalystX::InjectComponent or just stuffing an instance into
> $app->components hash).
> 
> I'd also like to be able to apply roles to existing controllers.   If I
> try to ->apply the role it fails if
> using MooseX::MethodAttributes::Role.  Which I assume is because the
> actions would not be registered with Catalyst.
> 
> Is there a way to inject actions in this way?   
> 
> 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 -- or
> dynamically add the actions.
> 
> 
> In general, what I'm after is a way to specify "with
> App::Feature::Widget;" in my app base class and bring in an entire feature.
> 
> I'm also looking at a "gatekeeper" type of feature control that Facebook
> is known for:
> 
> https://www.facebook.com/video/video.php?v=10100259101684977&oid=9445547199&comments
> <https://www.facebook.com/video/video.php?v=10100259101684977&oid=9445547199&comments>
> 
> 
> -- 
> Bill Moseley
> moseley at hank.org <mailto:moseley at hank.org>
> 
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/




More information about the Catalyst mailing list