Skip to content

Kirby 4.5.0

$segments->group()

Groups the elements by a given field or callback function

$segments->group(string|\Closure $field, bool $caseInsensitive = true): Kirby\Toolkit\Collection

Parameters

Name Type Default
$field * string|Closure
$caseInsensitive bool true

Return type

Kirby\Toolkit\Collection

Exceptions

Type Description
Exception if $field is not a string nor a callback function

Parent class

Kirby\Query\Segments inherited from Kirby\Toolkit\Collection