When I try to create the routes for a RESTful API with the following $url_handlers
, it seems to create a conflict between two of the patterns.
class API extends Controller {
...
private static $url_handlers = array(
'GET object' => 'read',
'POST object' => 'create',
'PUT object/$ID' => 'update',
'PUT object/$ID/$OtherID' => 'assign',
'DELETE object/$ID' => 'delete',
'DELETE object/$ID/$OtherID' => 'unassign',
);
...
}
object/1
works fine, but object/1/1
is matching to the update
action.
What extra detail do I add to make these patterns work?