Hi all,
I'm new to cakephp and I'm trying to run reverse routing so that I can
display friendly url. I've spent all day looking through tutorials but
unfortunately I was not able to find my mistake. Basically I have a
router:
Router::connect('/displays/:id::url_title', array('controller' =>
'displays', 'action' => 'view'), array(
'pass' => array('id', 'url_title'),
'id' => '[\d]+' ));
Controller:
<?php
class DisplaysController extends AppController {
var $name = 'Displays';
function view($id, $url_title = null) { //something... }
}
?>
and link in view:
echo $html->link('My post title', array(
'controller' => 'displays',
'action' => 'view',
'id' => 5,
'url_title' => 'something-goes-here'
));
According to the tutorial I should be able to run reverse routing and
get a link in the following format:
/displays/5:something-goes-here
However I always get something like: displays/view/5/url_title:my-post-
title. I'm doing something wrong but I can't find my mistake.
I will be thankful for any suggestions!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---