Reference

Guide

$pagination->lastPageUrl()

Returns the Url for the last page

$pagination->lastPageUrl(): string

Return type

string

Example

<?php
$subpages   = $page->children()->paginate(10);
$pagination = $subpages->pagination();
?>

<!-- foreach loop with subpages -->

<a href="<?= $pagination->lastPageUrl() ?>">
  Go to last page
</a>

Source code

kirby/src/Cms/Pagination.php#L112