我有一个以 GET 形式提交数据的表单
这意味着,当我这样做时:
echo $this->Form->create('Search', array('type'=>'get', 'url'=> array('controller'=>'searches','action'=>'results')));
echo '<div class="search-box">';
echo $this->Form->input('search', array(
'class' => 'search-input',
'placeholder' => 'Search Domain Names',
'label'=>false));
echo $this->Form->input('', array(
'class' => 'search-icon',
'label' => false,
'type' => 'submit'
));
echo $this->Form->end();
?>
我得到的网址为:example.com/Searches/results?search=asdadasdasd
我想构建路由,以便获得以下 URL:
example.com/search/asdadasdasd.html
我看了看:http ://book.cakephp.org/2.0/en/development/routing.html
我知道如何获得扩展名:http: //book.cakephp.org/2.0/en/development/routing.html#file-extensions
但是,我将如何在里面获取搜索查询?
谢谢