Skip to content

Kirby 6.0.0

$files->nth()

Returns the nth element from the collection

$files->nth(int $n): File|null

Parameters

Name Type Default
$nrequired int no default value

Return types

Kirby\Cms\Fileornull

Parent class

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

Examples

<?= $page->files()->nth(3)->filename() ?>