I need to set up routing based on search parms (I'm using CakeDC search plugin)
URL should look like this: /apartments/studio-apartments
/apartments/propertytype_id:1
I've already tried adding routes like this one:
Router::connect('/apartments/studio-apartments', array('controller'=>'apartments', 'action'=>'index'), array('pass'=>array('propertytype_id:1')));
or
Router::connect('/apartments/studio-apartments', array('controller' => 'apartments', 'action' => 'index', 'propertytype_id:1'));
开发者_JS百科
or that one from Cake book
Try this in your routes.php:
Router::connect('/apartments/studio-apartments',
array('controller' => 'apartments','action' => 'index'),
array('propertytype_id' => '[0-9\-]+')
);
精彩评论