Reference

Guide

$site->pages()

Alias for Site::children()

$site->pages(): Kirby\Cms\Pages

Return type

Kirby\Cms\Pages

Example

<nav class="main-menu" role="navigation">
  <ul>
    <?php foreach($site->pages()->listed() as $item): ?>
    <li><a<?php e($item->isOpen(), ' class="active"') ?> href="<?= $item->url() ?>"><?= html($item->title()) ?></a></li>
    <?php endforeach ?>
  </ul>
</nav>

Source code

kirby/src/Cms/Site.php#L418