Skip to content

Kirby 6.0.1

$nestCollection->keyOf()

Tries to find the key for the given element

$nestCollection->keyOf(NestCollection|NestObject|Field $needle): int|string|false

Parameters

Name Type Default Description
$needlerequired Kirby\Cms\NestCollectionorKirby\Cms\NestObjectorKirby\Content\Field no default value the element to search for

Return types

intorstringorfalse

the name of the key or false

Parent class

Kirby\Cms\NestCollection inherited from Kirby\Toolkit\Iterator