【问题标题】:Cakephp : 3 Pagination design has broken After Add BootstrapCakephp:添加引导程序后,3 分页设计已损坏
【发布时间】:2015-08-10 11:45:15
【问题描述】:

我已经在我的 index.ctp 文件中添加了这段代码,当我尝试添加下一个和上一个选项时,这里的设计被破坏了。

<div class="paginator">
    <nav>
        <ul class="pagination">
            <?= $this->Paginator->prev('< ' . __('previous')) ?>
            <?= $this->Paginator->numbers() ?>
            <?= $this->Paginator->next(__('next') . ' >') ?> 
        </ul>
    </nav>
        <p><?= $this->Paginator->counter() ?></p>
</div> 

图片看起来像

这里是

<?= $this->Paginator->numbers() ?>

它已经创建了一个带有类分页的 ul,所以我需要将 prev 和 next 列表添加到这个 ul 列表中,我该怎么做?请任何人帮助我。

【问题讨论】:

  • 好像上一个和下一个不是li 项目,因此它们超出了 ul.. 你检查时是这样吗?

标签: twitter-bootstrap pagination cakephp-3.0


【解决方案1】:

看看这个Pull Request的讨论

解决办法是这样的:

<ul class="pagination">
    <?= $this->Paginator->prev('< ' . __('previous')) ?>
    <?= $this->Paginator->numbers(['before' => '', 'after' => '']) ?>
    <?= $this->Paginator->next(__('next') . ' >') ?>
</ul>

【讨论】:

  • 可以给我链接吗?
【解决方案2】:

试试这个。它对我来说工作正常。

<div class="pagination pagination-right">
<span class="pull-left">
    <?php
    echo $this->Paginator->counter(
            'Showing {{start}} to {{end}} of total {{count}}'
    );
    ?>
</span>
<ul class="">
    <?php
    echo $this->Paginator->prev(__('previous'), array(), null, array('class' => 'prev disabled'));
    echo $this->Paginator->numbers(array('separator' => ''));
    echo $this->Paginator->next(__('next'), array(), null, array('class' => 'next disabled'));
    ?>
</ul>

【讨论】:

    【解决方案3】:

    我已经通过下面的代码解决了,这里是链接solution.@Ayman Alkum 给出了线索​​。

     <ul class="pagination">
              <?= $this->Paginator->prev('< ' . __('previous')) ?>
              <?= $this->Paginator->numbers(['before' => '', 'after' => '']) ?>
              <?= $this->Paginator->next(__('next') . ' >') ?>
     </ul>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-23
      • 1970-01-01
      • 1970-01-01
      • 2017-04-15
      • 1970-01-01
      • 2020-06-27
      • 2013-03-28
      • 2012-12-29
      相关资源
      最近更新 更多