alombarte/SIFO — pull request #16 by nilopc (2013-04-11 11:34:17+00:00)
Title: CSFR + Proposal of new routing system

- [NEW] Proposal of new routing system, keeping total compatibility with the old format too. Sifo\Controller.php, Sifo\Router.php and Bootstrap.php and CLBootstrap.php were modified.

- [NEW] Replace abstract function build() in Controllers for indexAction(). This makes more sense with this new routing approach. Modified instances/common/controllers modified to reflect this.

- [CRITICAL] Duplicate pages fixed by the new routing system. No longer it is possible to access the same content from different URLs using extra trailing slashes. Example: http://sifo.local/page and http://sifo.local/page/I_can_get_you_screwed_by_google no longer will show the same page.

Example of new routing system:
//Current way of accessing a controller
$config['demo'] = 'home/index';

//.. and this is the way!!
$config['demo'] = array(
'controller'=>'home/index::newRoutingAction',
'request_method'=>array('GET','POST')
);

$config['demo/{user_id}/profile'] = array(
'controller'=> 'home/index::newRoutingAction',
'request_method'=> array('GET','POST','DELETE'),
'placeholders'=> array( 'user_id' => '/^\d+$/')
);