FormBuilderField class

Maintains configuration for a field in a Form Builder form.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the FormBuilderField class also inherits all the methods and properties of: FormBuilderData.

Show class?     Show args?       Only hookable?    

Retrieval

NameReturnSummary 
FormBuilderField::child(string $name)
FormBuilderField null

Return the direct child given by $name

 
FormBuilderField::children()
array

Return array of all children


Can also be used as property: FormBuilderField::children
 
FormBuilderField::exists(string $name)
bool

Does field with this name exist?

 
FormBuilderField::fbForm()
FormBuilderForm null

Get the current FormBuilderForm instance for this field

 
FormBuilderField::getArray()
array

Return an array representing this field and children (when present)

 
FormBuilderField::getChildrenFlat()
array

Return a flattened (non structured) array of all children

 
FormBuilderField::getFieldByName(string $name)
FormBuilderField null

Get a field by name, within entire form

 
FormBuilderField::getInputfield()
Inputfield

Get new Inputfield for this FormBuilderField (for public API usage)

 
FormBuilderField::getSetting(string $key)
mixed null

Get a setting value only (no fallback to getting field by name)

 

Properties

NameReturnSummary 
FormBuilderField::columnWidth int Width of this field as a percent between 10 and 100. 
FormBuilderField::defaultValue string Default value of this field (if applicable) 
FormBuilderField::description string Optional description of field 
FormBuilderField::form FormBuilderForm Form instance that this filed is connected with 
FormBuilderField::formName string Name of the form this field belongs to 
FormBuilderField::label string Label for this field 
FormBuilderField::name string Name of field 
FormBuilderField::notes string Optional notes for field 
FormBuilderField::numChildren int Number of children this field has (if this field is a fieldset or form) 
FormBuilderField::parent FormBuilderField FormBuilderForm null Parent of this field 
FormBuilderField::required bool Is this field required? 
FormBuilderField::requiredIf string Selector condition when field is required, also requires that 'required' is true. 
FormBuilderField::showIf string Selector condition of when field is visible.  
FormBuilderField::type string Type of field 

Additional methods and properties

In addition to the methods and properties above, FormBuilderField also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252