CakePHP:Remove";第页:#;从url参数
我有一个使用CakePHP:Remove";第页:#;从url参数,php,forms,cakephp,parameters,cakephp-2.3,Php,Forms,Cakephp,Parameters,Cakephp 2.3,我有一个使用get方法的搜索表单。该表单工作正常,直到我在对结果分页后使用它为止 用户可以从任意数量的URL进入网站,这些URL看起来像domain.com/serach/results/something/something\u else/重要的部分是domain.com/serach/results/ 下面是我的表单代码: echo $this->Form->create(null, array( 'type' => 'get', 'url' => $
get
方法的搜索表单。该表单工作正常,直到我在对结果分页后使用它为止
用户可以从任意数量的URL进入网站,这些URL看起来像domain.com/serach/results/something/something\u else/
重要的部分是domain.com/serach/results/
下面是我的表单代码:
echo $this->Form->create(null, array(
'type' => 'get',
'url' => $this->Html->url(null, true),
));
<form action="http://domain.com/serach/results/something/something_else/page:3" method="get">
这将使表单如下所示:
<form action="http://domain.com/serach/results/something/something_else/" method="get">
问题是,当我对结果分页时,它会将第2页或第3页添加到操作中,因此看起来像:
echo $this->Form->create(null, array(
'type' => 'get',
'url' => $this->Html->url(null, true),
));
<form action="http://domain.com/serach/results/something/something_else/page:3" method="get">
CakePHP中是否有一个内置函数,允许我从传递给表单操作的url中删除
页面:3
,还是我必须创建一个函数来查找并删除页面:
只需以详细的方式设置url即可:
'url' => array('controller' => 'x', 'action' => 'y') + $this->request->params['pass']
完成了 只需以详细的方式设置url即可:
'url' => array('controller' => 'x', 'action' => 'y') + $this->request->params['pass']
完成了 这样做wat不起作用,因为它在动作后失去了一切。因此,它导致了这个
domain.com/serach/results/
,而不是这个domain.com/serach/results/something/something\u else/
。这样做wat不起作用,因为它在操作后失去了一切。因此它产生了这个domain.com/serach/results/
,而不是这个domain.com/serach/results/something/something\u else/
。