Try this one (untested): Router:connect('/:year/:controller/:action/*', null, array('year'=>'\d{4}'));
Cheers, Adam ModByChris wrote: > I have not been able to find the way around this an it seems like it > should be possible. > I have a News controller, and I am dealing with a biennial event, so I > have items for 2007,2009 and eventually more. I want to identify which > set of news items to display, but using the URLs: > > /2007/news/:action/* > and > /2009/news/:action/* > > (rather than the obvious "/news/:action/2007") > > which works fine, but I want it to be a bit more dynamic so I don't > have to create all the routes. > so I thought: > > Router:connect('/:year/news/:action/*',array('controller'=>'news', > 'action'=>'index'), array('year'=>'(2007|2009)')); > > (I define the regular expression at the top, so it's easy to > maintain.) > > But doing this Cake tries to use the year 2007 or 2009 as the ACTION, > and gives a missing action error. I can't figure out how to stop it, > so it actually passes the correct action. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---