Reference

Guide

$page->images()

Filters the Files collection by type image

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

Return type

Kirby\Cms\Files

Example

<section class="gallery">
  <?php foreach($page->images() as $image): ?>
  <figure>
    <a href="<?= $image->url() ?>">
      <img src="<?= $image->url() ?>" alt="">
    </a>
  </figure>
  <?php endforeach ?>
</section>

Source code

kirby/src/Cms/HasFiles.php#L198