Skip to content

Kirby 6.0.1

$fields->prepend()

Prepends an element to the data array

$fields->prepend(string|Field ...$args): Fields

Parameters

Name Type Default
...$args stringorKirby\Form\Field no default value

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

Examples

$collection->prepend($object);
$collection->prepend('key', $object);