Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 26, 2016 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cakephp-tutorial/a4caa3ca18f1c130350a to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/a4caa3ca18f1c130350a to your computer and use it in GitHub Desktop.
<?php
//url /hobbies/10/roma
Router::connect(
'hobbies/:id/:city',
array(
'controller' => 'hobbies',
'action' => 'search'
),
array(
'pass' => array('id', 'city'),
'id' => '[0-9]+',
)
);
//url /hobbies/roma/10
Router::connect(
'hobbies/:city/:id',
array(
'controller' => 'hobbies',
'action' => 'search'
),
array(
'pass' => array('id', 'city'),
'id' => '[0-9]+',
)
);
// public function search($id, $city) ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment