[Catalyst] Multiple chain sources?

Eden Cardim edencardim at gmail.com
Tue Nov 23 00:39:23 GMT 2010


>>>>> "Matthew" == Matthew Braid <catalyst at mdb.id.au> writes:

    Matthew> Hi all, Just wondering - is it possible for an action to
    Matthew> have multiple chain paths?

    Matthew> I'd like my site to have a path like /user/N/profile
    Matthew> (/user/N being a chain path, /profile being an end node off
    Matthew> that path), but also have a path like /my/profile (where
    Matthew> /my is a chain path that acts as if the user put their own
    Matthew> ID on the end of /user/N).

No, that's currently not possible with chained. Matt and I, howeever,
are working on a grammar-based dispatcher that will allow easy
expression of those types of constructs.
You'll have to declare something like:

sub my :Chained('base') CaptureArgs(0) {
  my($self, $c) = @_;
  $c->forward(user => [$c->user->id]);
}

and then chain onto that.

-- 
     Eden Cardim            Need help with your perl Catalyst or DBIx::Class project?
   Software Engineer                   http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.        Want a managed development or deployment platform?
http://blog.edencardim.com             http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list