【发布时间】:2012-08-09 05:53:37
【问题描述】:
如何获取最后一个页码,而不是 $this->Paginator->last() 附带的链接,而是实际数字本身?
【问题讨论】:
标签: cakephp cakephp-2.0 cakephp-2.1
如何获取最后一个页码,而不是 $this->Paginator->last() 附带的链接,而是实际数字本身?
【问题讨论】:
标签: cakephp cakephp-2.0 cakephp-2.1
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() 方法来获取最后的页码。
【讨论】:
另一种解决方案:
echo $this->Paginator->param('pageCount');
【讨论】: