I suspect it's because the colon is normally used to designate a named argument. You may be able to change the named argument delimiter, which might allow this to work. Honestly, I'd just change your route to use a slash (/) or you may be able to get a hypen to work.
Alternatively, set ID to be a single field comprised of /\d+:[\w_-]+/ and just split it at the : in your function. -Jonathan On 7/12/08, kik <[EMAIL PROTECTED]> wrote: > > 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 cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---