首先对不起我的英语。
我正在尝试在 cakePHP 2.8.3 中使用带有 ajax 的分页。
第一次加载效果很好。我看到分页器号码:
当我单击页码“2”或“Next >>”时,内容 #content-recherche会刷新,但链接页码 1(和链接“<< Previous”)不可用。页码“2”保持可点击...
这是我在控制器中的代码:
分页的公共变量:
public $paginate = array('Entite' => array(
'limit' => 2,
'order' => array(
'Entite.nom' => 'asc'
),
));
我的操作中的代码:
$this->Paginator->settings = $this->paginate;
$this->Paginator->settings = array(
'conditions' => $conditions,
//'limit' => $sql_limit
'limit' => 2
);
$data = $this->Paginator->paginate('Entite');
$this->set('data', $data);
我的代码在视图中:
<div id="content-recherche">
...
</div>
<ul class="pagination">
<?php
$this->Js->JqueryEngine->jQueryObject = 'jQuery';
$this->Paginator->options(array(
'update' => '#content-recherche',
'url' => array('controller' => 'Recherche', 'action' => 'coiffure'),
'complete' => '$.getScript("/js/utils.js", function (data, textStatus, jqxhr) {});',
'evalScripts' => true,
));
?>
<?php
echo $this->Paginator->numbers(array(
'first' => '<<',
'currentClass ' => 'active',
'tag' => 'li',
'modulus' => 5,
'last' => '>>'));
?>
<?php
echo $this->Paginator->prev(
'« Previous', null, null, array('class' => 'disabled')
);
echo $this->Paginator->next(
'Next »', null, null, array('class' => 'disabled')
);
?>
</ul>
有人看到我的错误是什么?
谢谢。