[Catalyst] Re: Overriding chained methods.
Eden Cardim
edencardim at gmail.com
Tue Feb 21 13:42:06 GMT 2012
>>>>> "Bill" == Bill Moseley <moseley at hank.org> writes:
Bill> What I was asking it how to override potentially any method in a
Bill> chain of Actions and to magically swap the the root of the
Bill> chain. Sounds ugly and confusing.
That's perfectly viable, here's a few scenarios:
- override the action sub and declare the new attributes accordingly
- if you don't want to mess with the chaining, make the chained
action forward to a private action, then override it
- if you do want to mess with the attributes (Chained, PathPart, etc.) use
configuration in the child controller, like this:
__PACKAGE__->config(action => { foo => { Chained => '/bar } });
Note that you can make any method in a controller magically become an action,
by merely providing config in the way described above.
--
Eden Cardim Need help with your Catalyst or DBIx::Class project?
Code Monkey http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://edencardim.com http://www.shadowcat.co.uk/servers/
More information about the Catalyst
mailing list