Skip to content

Kirby 3.8.4

$site->documents()

Filters the Files collection by type documents

$site->documents(): Kirby\Cms\Files

Return type

Kirby\Cms\Files

Parent class

Kirby\Cms\Site

Example

<h2>Available PDFs</h2>
<ul>
  <?php foreach($site->documents()->filterBy('extension', 'pdf') as $pdf): ?>
  <li>
    <a href="<?= $pdf->url() ?>">
      <?= $pdf->filename() ?>
      (<?= $pdf->niceSize() ?>)
    </a>
  </li>
  <?php endforeach ?>
</ul>