CakePHP在链接上搜索查询

时间:2011-05-09 22:54:36

标签: php cakephp

我有以下链接:<?php echo $this->Html->link('Students', array('controller' => 'users', 'action' => 'search', 'students'), array('title' => 'Students')); ?>

产生这个:/users/search/students

但我希望它能产生这个:/users/search:q=students

我该怎么做?感谢

1 个答案:

答案 0 :(得分:0)

这应该这样做:

echo $this->Html->link('Students',
    array('controller' => 'users', 'action' => 'search', 'search' => 'q=students'),
    array('title' => 'Students'));