Skip to content

Kirby 5.0.4

$pagination->pageUrl()

Returns the URL of the current page. If the $page variable is set, the URL for that page will be returned.

$pagination->pageUrl(int|null $page = null): string|null

Parameters

Name Type Default
$page intornull null

Return types

stringornull

This method modifies the existing $pagination object it is applied to and returns it again.

Parent class

Kirby\Cms\Pagination

<?php

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

?>

…

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