【问题标题】:CakePHP pagination ellipses not showingCakePHP 分页省略号不显示
【发布时间】:2014-05-13 18:43:42
【问题描述】:

有 11 页,我使用的是 modulus => 8,它一次显示 9 个页码。

以下是代码:

echo $this->Paginator->numbers(
    array('modulus' => 8,
        'separator' => false,
        'before' => '',
        'after' => '',
        'tag' => 'li',
        'class' => false,
        'currentClass' => 'disabled',
        'currentTag' => 'a'
    )
);

问题是省略号... 没有出现在分页编号中。我正在使用 cakephp 2.4.xx 并且在文档中它写道省略号会自动出现。

请指导我如何将... 带入页码。

【问题讨论】:

  • 你得到了什么 do - 将呈现的 html 添加到问题中。
  • @AD7six 我只是得到 1 - 9 的数字,没有 ....

标签: php cakephp pagination


【解决方案1】:

仅当 'first' 或 'last' 设置为整数值时才有效。

即:

echo $this->Paginator->numbers(
    array('modulus' => 8,
        'separator' => false,
        'before' => '',
        'after' => '',
        'tag' => 'li',
        'class' => false,
        'currentClass' => 'disabled',
        'currentTag' => 'a',
        'first' => 3,
        'last' => 3,
    )
);

【讨论】:

  • 谢谢!有用。你能解释一下它的工作原理吗...?
猜你喜欢
  • 2015-07-05
  • 2015-02-13
  • 2021-01-24
  • 2023-02-07
  • 2021-08-20
  • 2012-04-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多