$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
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