Reference

Guide

$pagination->pages()

Returns the total number of pages

$pagination->pages(): int

Return type

int

<?php

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

echo 'There are ' . $pagination->pages() . ' pages';

?>

Source code

kirby/src/Toolkit/Pagination.php#L211