I may be missing something obvious here, but I am struggling to get numbered pagination working. I have seen this code block for range pagination:
<nav>
<ul>
<?php if ($pagination->hasPrevPage()): ?>
<li>
<a href="<?= $pagination->prevPageURL() ?>">‹</a>
</li>
<?php else: ?>
<li>
<span>‹</span>
</li>
<?php endif ?>
<?php foreach ($pagination->range(10) as $r): ?>
<li>
<a<?= $pagination->page() === $r ? ' aria-current="page"' : '' ?> href="<?= $pagination->pageURL($r) ?>">
<?= $r ?>
</a>
</li>
<?php endforeach ?>
<?php if ($pagination->hasNextPage()): ?>
<li>
<a href="<?= $pagination->nextPageURL() ?>">›</a>
</li>
<?php else: ?>
<li>
<span>›</span>
</li>
<?php endif ?>
</ul>
</nav>
Which works great, but I want to output all the pagination links as numbers, without the next and previous links and without range()
applied. How do I go about this?