我想限制在cakephp的分页中可见的计数器。我该怎么办……?目前其默认显示为1-9作为页面链接。我尝试了限制,但因为它限制了我的帖子每页。我想限制计数器,而不是每页张贴。请帮帮我。
已修改...我试着根据答案取模..
我希望我的分页应该是这样的。如果它在第一页,那么。
1 2 3 ... Last如果它在页面的中间,那么..
First ... 6 7 8 ... Last如果它是最后的,那么。
First ... 11 12 13我尝试过的代码是。
<?php echo $this->Paginator->numbers(array('modulus' => '2', 'tag' => 'span','first'=>'First','ellipsis'=>'...', 'separator' => ' ', 'last'=>'Last' )); ?>发布于 2012-06-27 07:37:31
查看分页帮助器的文档:http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html
我认为你想要的是“模数-在当前页面两边包含多少个数字,缺省为8。”
因此,在您的视图中,您会看到类似以下内容:
// Limit numbers to 4 either side of current page
echo $this->Paginator->numbers(array('modulus' => 4));希望这能有所帮助。
https://stackoverflow.com/questions/11213507
复制相似问题