Reputation: 13
For example :
Router::connect(
'/:username',
array('controller' => 'users', 'action' => 'profile'),
array('pass' => array('username'))
);
If the username
parameter is prefixed by @
, then it will redirect to a method. If not, it will redirect to different method.
Note : I'm using version 2.8
Upvotes: 1
Views: 43
Reputation: 4469
This should work:
Router::connect(
'/@:username',
array('controller' => 'users', 'action' => 'action1'),
array('pass' => array('username'))
);
Router::connect(
'/:username',
array('controller' => 'users', 'action' => 'action2'),
array('pass' => array('username'))
);
Upvotes: 1