【问题标题】:hide url param cakephp with refresh使用刷新隐藏 url 参数 cakephp
【发布时间】:2014-09-22 09:25:37
【问题描述】:

如何在 cakephp 中隐藏/取消隐藏/屏蔽 URL 查询参数? 我尝试过使用 javascript,但在尝试他的以下页面时仍然出错。

视图和控制器

pastebin.com/8XEBzQSU

pastebin.com/pEjcU5ma

http://www.mywebsite.com/web/index/page:2?url=web

hideindex/page:2?url=web

查看

    </p>

        <?php
        $params = $this->Paginator->params();
        if ($params['pageCount'] > 1) {
        ?>
        <div>
        <ul class="pagination pagination-sm">
            <?php
                echo $this->Paginator->prev('&larr; Previous', array('class' => 'prev','tag' => 'li','escape' => false), '<a onclick="return false;">&larr; Previous</a>', array('class' => 'prev disabled','tag' => 'li','escape' => false));
                echo $this->Paginator->numbers(array('separator' => '','tag' => 'li','currentClass' => 'active','currentTag' => 'a'));
                echo $this->Paginator->next('Next &rarr;', array('class' => 'next','tag' => 'li','escape' => false), '<a onclick="return false;">Next &rarr;</a>', array('class' => 'next disabled','tag' => 'li','escape' => false));
            ?>
        </ul>
    </div>

控制器

if (isset($tmp) && $tmp){
            array_push($paginate['conditions'], $tmp);
        }

        //print_r($paginate);

        $this->paginate = $paginate;
    }
    $this->set('web', $this->Paginator->paginate());
}

【问题讨论】:

  • 不清楚您要完成什么。您的网址应该是什么样的?
  • 隐藏参数/index/page:id

标签: javascript cakephp cakephp-2.3


【解决方案1】:

如果不想使用 GET 请求分页,可以使用 AJAX 分页。

或者,看看here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-09
    • 1970-01-01
    • 1970-01-01
    • 2018-12-08
    • 1970-01-01
    相关资源
    最近更新 更多