• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pagination getPrevious() & getNext

#1
Hi,

I create a App/Views/Pagers/bootstrap_full.php file:

<?php $pager->setSurroundCount(2) ?>

<nav aria-label="Page navigation">
    <ul class="pagination">
    <?php if ($pager->hasPrevious()) : ?>
        <li class="page-item">
            <a href="<?= $pager->getFirst() ?>" aria-label="First" class="page-link"> 
                <i class="fas fa-angle-double-left"></i>
            </a>
        </li>
        <li class="page-item">
            <a href="<?= $pager->getPrevious() ?>" aria-label="Previous" class="page-link">
                <i class="fas fa-angle-left"></i>
            </a>
        </li>
    <?php endif ?>

    <?php foreach ($pager->links() as $link) : ?>
        <li <?= $link['active'] ? 'class="active page-item"' : 'class="page-item"' ?>>
            <a href="<?= $link['uri'] ?>" class="page-link">
                <?= $link['title'] ?>
            </a>
        </li>
    <?php endforeach ?>

    <?php if ($pager->hasNext()) : ?>
        <li class="page-item">
            <a href="<?= $pager->getNext() ?>" aria-label="Next" class="page-link">
                <i class="fas fa-angle-right"></i>
            </a>
        </li>
        <li class="page-item">
            <a href="<?= $pager->getLast() ?>" aria-label="Last" class="page-link">
                <i class="fas fa-angle-double-right"></i>
            </a>
        </li>
    <?php endif ?>
    </ul>
</nav>


but getPrevious() & getNext() links go to getFirst() & getLast() pages

I have some wrong?

thanks!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.