Skip to content

Kirby 5.1.1

$blocks->keyOf()

Tries to find the key for the given element

$blocks->keyOf(Kirby\Cms\Block $needle): int|string|false

Parameters

Name Type Default Description
$needlerequired Kirby\Cms\Block no default value the element to search for

Return types

intorstringorfalse

the name of the key or false

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

Parent class

Kirby\Cms\Blocks inherited from Kirby\Toolkit\Iterator