Skip to content

Kirby 6.0.0

$fields->update()

Updates an object in the collection

$fields->update(string|Field $key, Field|null $object = null): Fields

Parameters

Name Type Default Description
$keyrequired stringorKirby\Form\Field no default value Key or object to update
$object Kirby\Form\Fieldornull null New object for the key

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\Cms\Collection