【问题标题】:How can I include html tab into Paginator cakephp如何将 html 选项卡包含到 Paginator cakephp
【发布时间】:2017-04-10 03:12:09
【问题描述】:

我正在使用 paginator cakephp 它可以正常工作,但是我有一个这样的菜单:

所以分页在tab-2,当我点击下一步重新加载页面并自动转到tab-1时,有一个解决方案可以让它继续转到tab-2 ??

我尝试使用projectURL#tab-2,但仍然无法使用 这是控制器代码:

$this->Paginator->settings = array(
            'conditions' => array('user2' => $userId),
            'order' => array('Message.timestamp' => 'DESC'),
            'recursive' => 2 ,
            'limit' => 8
        );
// similaire à un findAll(), mais récupère les résultats paginés
$message = $this->Paginator->paginate('Message');

这是查看代码:

<?php foreach ($message as $recep){ ...} ?>
<ul class="pagination" style="margin-left: 25%; margin-top: 2%;">
<?php
    echo $this->Paginator->prev(__('précédent'), array('tag' => 'li'), null, array('tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
    echo $this->Paginator->numbers(array('separator' => '','currentTag' => 'a', 'currentClass' => 'active','tag' => 'li','first' => 1));
    echo $this->Paginator->next(__('suivant'), array('tag' => 'li','currentClass' => 'disabled'), null, array('tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
?>

【问题讨论】:

    标签: php jquery html cakephp pagination


    【解决方案1】:

    如果您还向页面添加一些 javascript,您使用 url#hash 的方法应该可以工作:

    window.onload = function() {
        if (window.location.hash) { //A hash exists in the url
            var hash = window.location.hash; //Now has the #hash part of the url
            //Code to open the tab here
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多