$nestCollection->indexOf()
Tries to find the index number for the given element
$nestCollection->indexOf(NestCollection|NestObject|Field $needle): int|false
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $needlerequired | Kirby\Cms\NestCollectionorKirby\Cms\NestObjectorKirby\Content\Field |
no default value | the element to search for |
Return types
intorfalse
the index (int) of the element or false
Parent class
Kirby\Cms\NestCollection
inherited from Kirby\Toolkit\Iterator