Skip to content

Kirby 5.0.4

$nestCollection->set()

Adds a new element to the collection

$nestCollection->set(array|string $key, Kirby\Cms\NestObject|Kirby\Content\Field|null $value = null): Kirby\Cms\NestCollection

Parameters

Name Type Default
$keyrequired arrayorstring no default value
$value Kirby\Cms\NestObjectorKirby\Content\Fieldornull null

Return type

Kirby\Cms\NestCollection

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

Parent class

Kirby\Cms\NestCollection inherited from Kirby\Toolkit\Collection