[Catalyst] Very basic chained question

Fagyal Csongor concept at conceptonline.hu
Wed Jan 18 03:56:09 GMT 2012


Sorry about this basic question, but I am kind of lost when it comes to 
chained dispatching.

I have a controller "Members::Profile" with methods "edit" and "images".

I would like "edit" called with the URL "/members/profile/edit", and 
"images" and *after that* "edit" called with "/members/profile/edit/images".

I thought this should look something like as:
sub edit: Local Args(0) { ... }
sub images: PathPart('images') Chained('edit') { ... }

But obviously I misunderstand something.

I have also tried:
sub edit :PathPart('edit') Chained('') CaptureArgs(0) { ... }
sub images :PathPart('images') Chained('edit') Args(0) { ... }

I guess this clearly shows I just have no idea how this is supposed to 
work :)

It actually works if I add another method like this:
sub edit :PathPart('members/profile/edit') Chained('/') CaptureArgs(0) { 
... }
sub images :PathPart('images') Chained('edit') Args(0) { ... }
sub root : PathPart('') Chained('edit') Args(0) { ... }

This kind of looks logical, but it don't think this is what I should do: 
I don't like the PathPart for edit, and the extra method either.

So how do I do this properly?

- Fagzal

More information about the Catalyst mailing list