I have a hyperlink defined as:

echo $html->link(__('Discuss', true), array('controller' => 'cars',
'action'=>'view', $car['Car']['id'], $car['Car']['make'],
$car['Car']['model']));

How can I define a route that changes the url from
'/cars/view/14/nissan/maxima' to '/cars/nissan/maxima'??

I did Router::connect('/cars/*', array('controller'=>'cars', 'action' =>
'view')) which got rid of the 'view' but not then I'm stuck with the 'id'

I tried something like:
Router::connect('/car/:make/:model', array('controller'=>'cars', 'action' =>
'view'), array('pass' => array('id', 'make', 'model')));

but that didn't seem to hide the id. Any help would be much appreciated,
thanks!
-- 
View this message in context: 
http://www.nabble.com/How-to-hide-id-with-router%3A%3Aconnect-tp25273147p25273147.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to