I’m exploring a few PHP frameworks and the current front runner is Kohana.
Having a Rails background I’ve become used to what the rails community calls “RESTful” routes. So a “GET /posts” displays all posts and is handled by the index method of the Posts Controller. A “POST /posts” creates a new post object and is handled by a different method of the Posts Controller.
Since the path in both these 2 requests is identical, the router needs to make decisions based on the HTTP method.
Is the router in Kohana capable of doing this?
Kohana does not support RESTful routes by default, but there is a RESTful module that adds support for it. See the RESTful wiki for usage.
Kohana v3.x supports RESTful controllers directly. Just extend
Controller_RESTinstead ofControllerand all the route action will be the request method. (APOSTrequest would be targeted toaction_post, etc.)