$nestCollection->set()
Adds a new element to the collection
$nestCollection->set(array|string $key, NestCollection|NestObject|Field|null $value = null): NestCollection
Parameters
| Name | Type | Default |
|---|---|---|
| $keyrequired | arrayorstring |
no default value |
| $value | Kirby\Cms\NestCollectionorKirby\Cms\NestObjectorKirby\Content\Fieldornull |
null
|
Return type
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