获取Cakephp中最后一页的数字

问题描述 投票:3回答:2

我如何得到最后一个页码,而不是$ this-> Paginator-> last()附带的链接,而是实际数字本身?

cakephp cakephp-2.0 cakephp-2.1
2个回答
3
投票

This link将帮助您实现同样的目标。

<?php echo $this->Paginator->counter('{:pages}');
     //counter() method with all options
     //echo $this->Paginator->counter('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}');?>

您可以在视图中调用counter()方法以获取最后一个页码。


0
投票

另一种方案:

echo $this->Paginator->param('pageCount');
© www.soinside.com 2019 - 2024. All rights reserved.