Lots of chain. I use something like this:

package MyApp::Controller::Admin;

sub lang : Chained('/') PathPart('') CaptureArgs(1) {
   # Capture the language selection from the requested uri
}

sub base : Chained('lang') PathPart('admin') CaptureArgs(0) {
   # Does nothing but lets me chain other things on /en/admin
   # that do not need any common initialisation
}

sub users : Chained('base') PathPrefix CaptureArgs(0) {
   # Stashes things common to all endpoints chained on /en/admin/users
}

sub view_form : Chained('users') PathPart('') Args {
   # Endpoint with optional argument
}

which gives (I think since this was hacked down from what I really have)

/en/admin/users/123

--

Regards

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to