Skip to content

Kirby 5.0.2

$items->getAttribute()

Extracts an attribute value from the given element in the collection. This is useful if elements in the collection might be objects, arrays or anything else and you need to get the value independently from that. We use it for filter.

$items->getAttribute(object|array $item, string $attribute, bool $split = false, $related = null)

Parameters

Name Type Default
$itemrequired objectorarray no default value
$attributerequired string no default value
$split bool false
$related mixed null

Parent class

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