Skip to content

Kirby 4.4.1

$site->audio()

Filters the Files collection by type audio

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

Return type

Kirby\Cms\Files

Parent class

Kirby\Cms\Site

Example

<h2>Songs</h2>
<?php foreach($site->audio() as $audio): ?>
<audio controls>
  <source src="<?= $audio->url() ?>" type="<?= $audio->mime() ?>">
</audio>
<?php endforeach ?>