cakephp - 获取Cakephp中最后一页的数字

标签 cakephp cakephp-2.0 cakephp-2.1

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

最佳答案

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}');?>

您可以在 View 中调用 counter() 方法来获取最后页码。

关于cakephp - 获取Cakephp中最后一页的数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11877480/

相关文章:

php - xml中具有相同名称的多个节点

php - 通过部门的总额(包括公司)

php - CakePHP 和 Bootstrap 表单集成

mysql - CakePHP 发送多封电子邮件而不是一封

cakephp - 在 CakePHP 的 beforeFilter 中渲染后停止执行

php - 扩展 CakePHP Find 方法

cakephp-2.1 - 将两个相关模型的字段组合成显示字段蛋糕 PHP 2.0

CakePHP 路由 - [home]/slug 作为 URL

php - 如何将多维数组插入到 cakephp 2.2.1 数据库中?

cakephp - 从外部 ctp 文件中获取 block