Skip to content

Kirby 5.0.4

$fields->keyOf()

Tries to find the key for the given element

$fields->keyOf(Kirby\Form\Field|Kirby\Form\FieldClass $needle): int|string|false

Parameters

Name Type Default Description
$needlerequired Kirby\Form\FieldorKirby\Form\FieldClass no default value the element to search for

Return types

intorstringorfalse

the name of the key or false

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

Parent class

Kirby\Form\Fields inherited from Kirby\Toolkit\Iterator