Ticket #882 (closed Feature Request: fixed)

Opened 6 weeks ago

Last modified 5 weeks ago

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.

Change History

Changed 5 weeks ago by Shadowhand

  • status changed from new to closed
  • version changed from 2.3 Release to SVN HEAD
  • resolution set to fixed

Fixed in r3605.

Changed 5 weeks ago by Shadowhand

Here's an example of using the new routing.

Note: See TracTickets for help on using tickets.