Skip to content

Kirby 5.0.4

$field->data()

Deprecated in 5.0.0
Use ::toStoredValue() instead to receive
the value in the format that will be needed for content files.

If you need to get the value with the default as fallback, you should use
the fill method first $field->fill($field->default())->toStoredValue()
$field->data(bool $default = false): mixed

Parameters

Name Type Default
$default bool false

Return type

mixed

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

Parent class

Kirby\Form\Field