EllisLab/CodeIgniter — Issue #1110: Routing, and http verb (or http method)
Author: roberto-butti
Created: 2012-03-03 11:37:15+00:00
State: open

I'm going to implement a new rounting functionality.
In application/config/routes.php the developers can define routing rules such as:
$route['product/:num'] = "catalog/product_lookup";
This rule has 1 input: the URL and 1 output the action in a specific controller.
I would like to introduce the HTTP method in the routing rules for example:
$route['product/:num'] = array("action" => "catalog/product_lookup", "method"=> "GET");
$route['product/:num'] = array("action" => "catalog/product_edit", "method"=> "POST");

For backward compatibility, the rules:
$route['product/:num'] = "catalog/product_lookup";
is still valid and the system/core/Router.php will check if the rules is a string i follow the normal behaviour, if is array i will check also the HTTP method.

What do you think about tihs?