Field
A Field object represents one field instance on a form. This is different from the general idea of a field type; here, you are working with the actual field that is being rendered, inspected or processed.
Properties
Type: string|int|null
The form-field instance ID. Submission and client field identity use this instance, not its shared definition.
Type: string|null
The form-field instance UID. Copies and new imports receive new instance UIDs.
Type: int|null
The shared definition's database ID. Synced fields share this value. It is not a submission content key.
Type: string|null
The shared definition's portable UID, used when a stencil explicitly preserves a Synced Field relationship.
Type: string|null
The field label.
Type: string|null
The field handle.
Type: string|null
The stable field reference, when available.
Type: string
The field type.
Type: verbb\formie\elements\Form|null
The Form this field belongs to.
Type: bool
Whether the field is required.
Type: bool
Whether the field is enabled.
Type: verbb\formie\models\RichText
The field instructions.
Type: string|null
The field placeholder, where supported.
Type: mixed
The field default value, where supported.
Type: array
The field settings.
Methods
The methods below help you render fields and read their values. For implementing storage and value handling in your own field type, see Custom Field.
Returns: bool
Returns whether the field should render a label.
Returns: string
Returns the field’s HTML id value.
Returns: string
Returns the field’s HTML name value.
Returns: array
Returns attributes for the field container.
Returns: array
Returns attributes for the field input, where applicable.
Returns the field’s front-end input HTML.
Returns: string|bool|null
Returns the field’s reference-block HTML.
Returns: verbb\formie\base\FieldInterface|null
Returns the parent field for sub-fields and nested fields.
Sets the parent field for sub-fields and nested fields.
Returns: mixed
Returns a string representation of a submitted value.
Returns: mixed
Returns natural JSON-safe data: scalars for primitive fields, named parts or selected records for rich fields.
Returns: mixed
Returns the value prepared for export.
Returns: mixed
Returns the value prepared for summary views.
Returns: mixed
Returns the value prepared for singular reference contexts.
Returns: mixed
Returns the value prepared for reference-block rendering.