Ticket #882 (closed Feature Request: fixed)
REQUEST_METHOD routing
| Reported by: | maulin | Owned by: | Shadowhand |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.3 |
| Component: | Core | Version: | SVN HEAD |
| Keywords: | Cc: |
Description
To make it easy to use Kohana to build web services (REST or others), it would be VERY nice to be able to easily include the REQUEST_METHOD in the Router to map to a particular controller/method. I think Hordes does this as well, so perhaps they could be a model (though I don't know a lot about that). It seems to me, just adding a field to the routes should do it:
$configrest? = array(
'POST' => array(
//usual routes stuff here
),
'PUT' => array(
//usual routes stuff here
)
'GET' => array(
//usual routes stuff here
)
'DELETE' => array(
//usual routes stuff here
)
)
I have an example of how I accomplished this with CI at http://blog.medryx.org/2008/10/03/codeigniter-rest/, if that helps at all.
Thanks.
