Thanks for the reply but I'm not always going to have just the q parameter. For instance, sometimes I have something like:
/search/q:search+terms/country:us/region:oh/ /search/country:us/region:oh/city:columbus/ /search/country:us/page:2/ I don't really want to use pass to send it to the controller, I would like to just get them w/ $this->params['named']. On Sep 16, 6:48 pm, brian <bally.z...@gmail.com> wrote: > Try this: > > Router::connect( > '/search/:q', > array( > 'controller' => 'skateparks', > 'action' => 'index' > ), > array( > 'q' => '[\+a-zA-Z]+', > 'pass' => array('q') > ) > ); > > function index($q = null) > { > ... > > } > > But, personally, I think you should create a search() method and leave > index() for listing *all* of your skateparks. > > > > On Wed, Sep 16, 2009 at 11:46 AM, Kyle Decot <kdec...@gmail.com> wrote: > > > Thanks for the reply but I'm still getting the same results. Any other > > suggestions? > > > On Sep 16, 7:15 am, Martin Westin <martin.westin...@gmail.com> wrote: > >> I think you can drop the wildcard and it will work. > >> Router::connect('/search', array('controller' => 'skateparks', > >> 'action' => 'index')); > > >> /Martin > > >> On Sep 16, 4:38 am, Kyle Decot <kdec...@gmail.com> wrote: > > >> > I am having a little bit of trouble w/ my reverse routing. In my > >> > routes.php file I have: > > >> > Router::connect('/search/*', array('controller' => 'skateparks', > >> > 'action' => 'index')); > > >> > Then in my view I do something like: > > >> > $html->link("Search for Something",array > >> > ("controller"=>"skateparks","action"=>"index","q"=>"search+terms")); > > >> > I want to get something like: > > >> >http://localhost/search/q:search+terms/ > > >> > but instead I get: > > >> >http://localhost/skateparks/index/q:search+terms/ > > >> > What is it that I am doing wrong? --~--~---------~--~----~------------~-------~--~----~ 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---