I have this router:
Router::connect
(
':renting/:model_name/:number_name/',
array('controller' => 'cars', 'action' => 'view'),
array(
'pass' => array('renting', 'model_name', 'number_name'),
'renting' => 'renting'
)
);
When I do this in a view
$html->link("NAME",
array(
'controller' => 'cars',
'action' => 'view',
'renting',
$model_name,
$number_name
)
);
I obtain this link on the page: mypage.com/cars/view/renting/mustang/03212xd
and i need obtain mypage.com/renting/mustang/03212xd
Im stuck here. Thank you. Note: muypage.com/renting/mustang/03212xd redirects right to my controller function but not when use $html->link function.
If you name your parameters, you need to name your parameters:
If
:rentingis always'renting', you don’t need to parameterize it: