Skip to content

$files->shuffle()

Shuffle all elements

$files->shuffle(): Kirby\Toolkit\Collection

Return type

Kirby\Toolkit\Collection

Parent class

Kirby\Cms\Files inherited from Kirby\Toolkit\Collection

Example

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