Reference

$pagination->page()

Getter and setter for the current page

$pagination->page(int $page = null): int|\Pagination

Parameters

Name Type Default Description
$page int null

Return type

int|\Pagination

Example

<?php

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

echo 'The current page is ' . $pagination->page();

?>

Source code

kirby/src/Toolkit/Pagination.php#L116