Skip to content

Kirby 6.0.1

$fields->set()

Adds a new element to the collection

$fields->set(array|string $key, Field|null $value = null): Fields

Parameters

Name Type Default
$keyrequired arrayorstring no default value
$value Kirby\Form\Fieldornull null

Return type

Kirby\Form\Fields

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

Parent class

Kirby\Form\Fields inherited from Kirby\Toolkit\Collection