Skip to content

Kirby 4.4.1

$pagination->pageUrl()

Returns the URL of the current page.

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

Parameters

Name Type Default
$page int|null null

Return type

string|null

Parent class

Kirby\Cms\Pagination

<?php

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

?>

…

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