Skip to content

Kirby 5.3.0

$lazyCollection->indexOf()

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

$lazyCollection->indexOf(string|TValue $needle): int|false

Parameters

Name Type Default
$needlerequired stringorTValue no default value

Return types

intorfalse

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

Parent class

Kirby\Cms\LazyCollection inherited from Kirby\Cms\Collection