在我的分页中,有重复的最后一页编号。
This is my current pagination.
<?php
$last = $this->Paginator->counter('{:pages}');
$first = $last - $last + 1;
?>
<ol>
<?php
echo $this->Paginator->first($first,array('tag'=>'li','currentTag'=>'a',
'escape' => false));
echo $this->Paginator->prev('«', array('tag' => 'li', 'title' => __('Previous page'), 'disabledTag' => 'span', 'escape' => false), null, array('tag' => 'li', 'disabledTag' => 'span', 'escape' => false, 'class' => 'disabled'));
echo $this->Paginator->numbers(array('modulus' => '4', 'separator' => false, 'tag' => 'li', 'currentTag' => 'a'));
echo $this->Paginator->next('»', array('tag' => 'li', 'disabledTag' => 'span', 'title' => __('Next page'), 'escape' => false), null, array('tag' => 'li', 'disabledTag' => 'span', 'escape' => false, 'class' => 'disabled'));
echo $this->Paginator->last($last, array('tag' => 'li', 'currentTag' => 'a', 'escape' => false));
?>
</ol>
答案 0 :(得分:0)
您可以随时使用此方法$ this-&gt; Paginator-&gt; current($ model),这将为您提供当前页码
namespace
我希望这会对你有所帮助。这里是您可以获取有关paginator helper类的信息的链接。