[Catalyst] Is it possible somehow to mix and match path parts using
Chained?
Dennis Daupert
ddaupert at gmail.com
Tue Jun 9 17:55:23 GMT 2009
I have a requirement to be able to do things like this:
A user creates "actionitems" which are just task notes.
An actionitem might not be associated with a project,
or a meeting, or assigned to another user, etc. Later,
it might be attached to a meeting; then all actionitems
associated with that meeting can be listed; individual items
can be updated, etc. Also, there might be several meetings
associated with a given project. We want to list those,
list the actionitems associated with particular projects,
etc.
I have a lot of this worked out using Chained, but there's a problem.
I've got controller classes like:
C::P::Actionitems
C::P::Meetings
C::P::Users::Profile::Actionitems
C::P::Users::Profile::Meetings
C::P::Users::Profile::Meetings::Actionitems
etc
It gets yukkie fast. I'm looking for a way to, -- as the
documentation says -- "redispatch a chain through any controller
or namespace you want," and I'd certainly like to stay DRY. I need to be
able to mix and match methods, so I can serve URLs like these:
/project/list # self explanatory
/meeting/list # self explanatory
/project/*/meeting/list # meetings associated to a project
/user/*/project/list # projects user is member of
/user/*/actionitem/create # unassociated item
/user/*/actionitem/*/edit # unassociated item
/user/*/meeting/*/actionitem/list # items associated to a meeting
/user/*/meeting/*/actionitem/*/edit # edit a particular meeting's item
/user/*/project/*/meeting/*/actionitem/*/edit # yada yada
In this scenario, actions may be endpoints in some situations, links in
others.
To put it another way, is there a way to have actions like these, and use
Chained to dispatch around?
C::P::Users
C::P::Actionitems
C::P::Meetings
C::P::Projects
Is this even possible to do using Chained? If not, what would be
recommended?
/dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090609/718fd=
de1/attachment.htm
More information about the Catalyst
mailing list