$pages->nth()
Returns the nth element from the collection
$pages->nth(int $n): mixed
Parameters
Name | Type | Default | Description |
---|---|---|---|
$n |
int |
– |
Return type
mixed
Example
// echo the title of the 4th subpage
// (the index starts at 0)
echo $page->children()->nth(3)->title();
Inherited from
Kirby\Toolkit\Collection