开发者

CakePHP routing - search parms

I need to set up routing based on search parms (I'm using CakeDC search plugin)

URL should look like this: /apartments/studio-apartments

instead of this: /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\-]+')
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜