Skip to content

Kirby 5.0.0

$items->indexOf()

Correct position detection for objects. The method will automatically detect objects or ids and then search accordingly.

$items->indexOf(string|Kirby\Cms\Item $needle): int|false

Parameters

Name Type Default
$needlerequired stringorKirby\Cms\Item no default value

Return types

intorfalse

Parent class

Kirby\Cms\Items inherited from Kirby\Cms\Collection