Skip to content

Kirby 4.4.1

$files->first()

Returns the first element

$files->first(): mixed

Return type

mixed

Parent class

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

Example

<?php if($file = $page->files()->first()) {
  echo $file->filename();
} ?>