Skip to content

Kirby 5.3.0

$lazyCollection->findBy()

Find a single element by an attribute and its value

$lazyCollection->findBy(string $attribute, $value): TValue|null

Parameters

Name Type Default
$attributerequired string no default value
$valuerequired mixed no default value

Return types

TValueornull

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