开发者

Cakephp: Need to urlencode GET form

I have the following form that uses a GET to pass parameters to a controller:

<?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>

The parameters aren't being urlencoded. What would be the best way for me to achieve that? Do I need to use javascript since the url is being built by the browser?

I'm using version 1.3.7.


I ended up making it a POST and I didn't have to deal with urlencoding.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜