$pages->nth()
Returns the nth element from the collection
$pages->nth(int $n): Page|null
Parameters
| Name | Type | Default |
|---|---|---|
| $nrequired | int |
no default value |
Return types
Kirby\Cms\Pageornull
Parent class
Kirby\Cms\Pages
inherited from Kirby\Toolkit\Collection
Examples
// echo the title of the 4th subpage
// (the index starts at 0)
echo $page->children()->nth(3)->title();