Skip to content

Instantly share code, notes, and snippets.

@marcincodes
Created November 9, 2013 16:34
Show Gist options
  • Save marcincodes/7387152 to your computer and use it in GitHub Desktop.
Save marcincodes/7387152 to your computer and use it in GitHub Desktop.
//Router wyglada tak
Router::connect(
'/forum/:id-:slug', // E.g. /blog/3-CakePHP_Rocks
array('controller' => 'forum', 'action' => 'show'),
array(
// order matters since this will simply map ":id" to $articleId in your action
'pass' => array('id', 'slug'),
'id' => '[0-9]+'
)
);
Router::connectNamed(false, array('separator' => '-', 'default' => true, 'reset' => true));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment