[Catalyst] Multiple Chain Actions

Derek Wueppelmann dwueppel at gmail.com
Fri Jul 17 20:53:18 GMT 2009

On Thu, 2009-07-16 at 20:22 +0100, Tomas Doran wrote:
> package MyApp::Controller::JSON;
> with 'MyApp::Stuff';
> sub root : Chained('/') PathPart('json') CaptureArgs(0) {}
> Will give you:
> /thingie
> and
> /json/thingie

This seems to be a decent option. However this will result in a fair
number of mostly empty modules being created. For example to get:


I would have to create a module that just contained:

package MyApp::Controller::JSON::Object;
with 'MyApp::ObjectStuff';

sub root : Chained('/') PathPart('json/object') CaptureArgs(0) {}

Since there will be nothing else to add to this, in most cases.

Is there a way to use multiple methods to achieve something similar.
Somting like this:

sub root : Chained('/json') PathPart('object') ChainedArgs(0) { ... }

sub update : Chained('root') PathPart('update') Args(0) { 

sub update_json : Chained('object') Args(0) {

 o)   Derek Wueppelmann           (o
(D .   dwueppel at gmail.com          D).
((`     http://www.monkeynet.ca   ( ) `

More information about the Catalyst mailing list