Skip to content

Kirby 4.4.1

$pagination->nextPageUrl()

Returns the Url for the next page.

$pagination->nextPageUrl(): string|null

Return type

string|null

Parent class

Kirby\Cms\Pagination

Example

<?php

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

?>

<!-- foreach loop with subpages -->

<?php if($pagination->hasPrevPage()): ?>
<a href="<?= $pagination->prevPageUrl() ?>">
  prev (<?= $pagination->prevPage() ?>)
</a>
<?php endif ?>

<?php if($pagination->hasNextPage()): ?>
<a href="<?= $pagination->nextPageUrl() ?>">
  next (<?= $pagination->nextPage() ?>)
</a>
<?php endif ?>