Skip to content

Kirby 5.0.4

$files->nth()

Returns the nth element from the collection

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

Parameters

Name Type Default
$nrequired int no default value

Return types

Kirby\Cms\Fileornull

This method modifies the existing $files object it is applied to and returns it again.

Parent class

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

Examples

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