Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将html选项卡包含到Paginator cakephp中_Php_Jquery_Html_Cakephp_Pagination - Fatal编程技术网

如何将html选项卡包含到Paginator cakephp中

如何将html选项卡包含到Paginator cakephp中,php,jquery,html,cakephp,pagination,Php,Jquery,Html,Cakephp,Pagination,我正在使用paginator cakephp,它可以正常工作,但我有一个这样的菜单: 因此,分页在选项卡2中,当我单击“下一步”重新加载页面并自动转到选项卡1时,有一个解决方案可以让它一直转到选项卡2 我试图使用projectURL#tab-2,但仍然不起作用 这是控制器代码: $this->Paginator->settings = array( 'conditions' => array('user2' => $userId),

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

因此,分页在
选项卡2
中,当我单击“下一步”重新加载页面并自动转到选项卡1时,有一个解决方案可以让它一直转到选项卡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'));
?>

如果您还向页面添加了一点javascript,那么您使用url散列的方法应该有效:

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