Reference

$page->children()

Returns the Pages collection

$page->children(): Pages

Return type

Pages

Example

<h2>Subpages</h2>
<ul>
  <?php foreach($page->children() as $subpage): ?>
  <li>
    <a href="<?= $subpage->url() ?>">
      <?= html($subpage->title()) ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>

Source code

kirby/src/Cms/HasChildren.php#L29