Originally I thought this was an optional new feature, but for those who were passing arrays with arbitrary named values to Router::url() and its friends HtmlHelper::url() and HtmlHelper::link(), note that the parameter must be defined with a $Route->connectNamed() in routes.php or the router won't know how to create the URL. Thanks biesbjerg!
On Sep 10, 5:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Thanks, I was not aware of the new explicit nature. > > On Sep 10, 5:15 pm, biesbjerg <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Correct way to implement above route would be: > > > Router::connectNamed(array('community_id')); > > Router::connect('/:community_id/bulletins/:action/*', > > array('controller' => 'bulletins'), array('community_id' => > > '[0-9]+')); > > > On Sep 10, 10:40 pm, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > I have been working all morning on this without any luck. This is on > > > Cake 1.2 (branch) / 5626. The only nonstandard thing I'm doing is app > > > and webroot dirs outside the normal locations (and renamed), but that > > > shouldn't make a difference with this. > > > > ROUTE > > > $Route->connect('/:community_id/bulletins/:action/*', > > > array('controller' => 'bulletins')); > > > > CONTROLLER/VIEW > > > echo $html->url(array('community_id'=>203, 'controller'=>'bulletins', > > > 'action'=>'view', 'bulletin_id'=>23423)); > > > > EXPECTED URL: > > > /203/bulletins/view/bulletin_id:23423 > > > > RETURNED URL: > > > /bulletins/view > > > > MODIFICATION (bulletin_id param removed) > > > echo $html->url(array('community_id'=>203, 'controller'=>'bulletins', > > > 'action'=>'view')); > > > > RETURNED URL: > > > /203/bulletins/view --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---