Skip to content

Kirby 5.0.4

$segments->set()

Adds a new element to the collection

$segments->set(array|string $key, Kirby\Query\Segment|null $value = null): Kirby\Query\Segments

Parameters

Name Type Default
$keyrequired arrayorstring no default value
$value Kirby\Query\Segmentornull null

Return type

Kirby\Query\Segments

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

Parent class

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