[Catalyst] PathPart help
Les Fletcher
les at affinitycircles.com
Thu Nov 15 19:47:34 GMT 2007
I have question about setting up PathPart's and Chaining. I am trying
to set something that has the following look:
/namespace/ => This lists out a list of objects
/namespace/<id> => displays detail information about the object with the
numeric id=<id>
/namespace/<id>/edit => brings up a form to edit object with numeric id=<id>
/namespace/create => brings up a form to create a new object
When the Chained actions are printed out everything looks fine, but when
I goto "/namespace/create" it matches the "/namespace/<id>" view
action. Needless to say, there isn't an object with the numeric id of
"create."
I would like for Catalyst to try and match the explicit PathPart before
matching the wild card that is <id>. Any thoughts on best ways to get
around this?
A couple of ways I thought of were:
I could make the view path be "/namespace/<id>/view," it seems a little
weird, but would be acceptable if need be.
I could have an action that matches "/namespace/*" and then forward to
the create action if "*" is "create" and to the view action other wise,
but this could limit my ability to further chain from here.
Catalyst just might not match the paths in a way that is conducive to
this, but just thought I'd throw this out there.
Les
More information about the Catalyst
mailing list