views:

13

answers:

0

Here is my route in JSON:

"jobs":
{
    "type":"Zend_Controller_Router_Route",
    "route":"/jobs/:action/:id/*",
    "defaults":
    {
     "module":"api",
     "controller":"jobs",
     "action":"index",
     "id":0
    }
}

This allows for URIs like the following and works perfectly well so far:

/jobs/ -> action=index, id=0
/jobs/view/1 -> action=view, id=1
/jobs/edit/1 -> action=edit, id=1

However, I would like the :action position to also allow for URIs like the following:

/jobs/type/volunteer -> action=index, type=volunteer
/jobs/search/php%20developer -> action=index, search=php developer

So far I'm accomplishing this within App_Controller_Action::__call(). It works, but it's messy because until the request is dispatched, the action is technically still listed as "search" or "term", and the value meant for those keys is assigned to id.

This is causing an issue in my Zend_Acl checks Im doing in a front controller plugin. As a workaround I've added "search" and "type" as permissions to my ACL but again, this is messy. The ACL should remain clean of those semantics. Id like for the request to be modified before it gets to the ACL plugin.

Thanks in advance!