<!-- Pagination - Views/pagination.php include this view in your view or layout. -->
<div class="pagination justify-content-center mb-4">
<?php if ( ! empty($pager)) :
//echo $pager->simpleLinks('group1', 'bs_simple');
echo $pager->links('group1', 'bs_full');
endif ?>
<!-- Bootstrap 5.1.3 code to show page 1 of 4 total pages using a button. -->
<div class="btn-group pagination justify-content-center mb-4" role="group" aria-label="pager counts">
<!-- NOTE: $currentPage and $totalPages are set in the Controllers $data and passed in to the view. -->
<button type="button" class="btn btn-light"><?= 'Page '.$currentPage.' of '.$totalPages; ?></button>
</div>
</div> <!-- End of pagination -->
// Controller
$data = [
'pager' => $posts->pager,
'currentPage' => $posts->pager->getCurrentPage('group1'),
'totalPages' => $posts->pager->getPageCount('group1'),
];