Reference

Guide

$page->files()

Returns the Files collection

$page->files(): Kirby\Cms\Files

Return type

Kirby\Cms\Files

Example

<h2>Files</h2>
<ul>
  <?php foreach($page->files() as $file): ?>
  <li>
    <a href="<?= $file->url() ?>">
      <?= $file->filename() ?>
      (<?= $file->niceSize() ?>)
    </a>
  </li>
  <?php endforeach ?>
</ul>

Source code

kirby/src/Cms/HasFiles.php#L112