0
我有一个使用GET将参数传递到控制器以下形式:CakePHP的:需要的URLEncode GET形式
<?php echo $form->create('Entity', array('controller'=>'entities', 'name' => 'SearchForm','action'=>'index', 'type'=>'GET')); ?>
<table class="searchTable">
<tr>
<td>
<?php
$ticker = (isset($this->passedArgs['ticker'])) ? $this->passedArgs['ticker'] : "";
echo $this->Form->input('ticker', array("value"=>$ticker));
?>
</td>
</tr>
<tr>
<td>
<?php
$name = (isset($this->passedArgs['full_name'])) ? $this->passedArgs['full_name'] : "";
echo $this->Form->input('Description', array("value"=>$name));
?>
</td>
</tr>
<tr>
<td>
<?php
$country = (isset($this->passedArgs['country'])) ? $this->passedArgs['country'] : "";
$country_id = (isset($this->passedArgs['country_id'])) ? $this->passedArgs['country_id'] : "";
echo $this->Form->input('country', array("value"=>$country));
echo $this->Form->hidden('country_id', array('value'=>$country_id));
?>
</td>
</tr>
<tr>
<td><?php echo ' Filters enabled:';?></td>
</tr>
<tr>
<td>
<?php
$enable = isset($this->params['named']['enable']) ? $this->params['named']['enable'] : null;
echo $form->input('enable', array('label'=>false,'type'=>'checkbox', 'checked'=> (boolean) $enable));
?>
</td>
</tr>
<tr>
<td><?php echo $this->Form->end(__('Refresh List', true)); ?></td>
</tr>
</table>
的参数不被urlencoded进行。对我来说,最好的办法是什么?由于浏览器正在构建网址,是否需要使用JavaScript?
我使用的是版本1.3.7。