FormBuilderField class

Located in file /site/modules/FormBuilder/FormBuilderField.php

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?        

Common

NameReturnSummary 
FormBuilderField::add(FormBuilderField $child)
$thisAdd a new child to this form/field 
FormBuilderField::allFields()
array FormBuilderField nullCheck if field present in allFields or add field to it 
FormBuilderField::child(string $name)
FormBuilderField nullReturn the direct child given by $name 
FormBuilderField::children()
arrayReturn array of all children
Can also be used as property: FormBuilderField::children
 
FormBuilderField::columnWidth int 
FormBuilderField::defaultValue string 
FormBuilderField::description string 
FormBuilderField::fbForm()
FormBuilderForm null@return FormBuilderForm|null 
FormBuilderField::find(string $name)
FormBuilderField nullRecursively find the field named $name (alias of getFieldByName) 
FormBuilderField::findAll()
arrayGet contents of the self::$allFields property containing all addded fields at runtime 
FormBuilderField::form FormBuilderForm 
FormBuilderField::formName string 
FormBuilderField::get(string $key)
mixedGet a value from this form field 
FormBuilderField::getArray()
arrayReturn an array representing this field and children (when present) 
FormBuilderField::getChildrenFlat()
arrayReturn a flattened (non structured) array of all children 
FormBuilderField::getDefaultsArray()
arrayGet default settings for a blank FormBuilderField object 
FormBuilderField::getFieldByName(string $name)
FormBuilderField nullGet a field by name, within entire form 
FormBuilderField::getInputfield()
InputfieldGet new Inputfield for this FormBuilderField (for public API usage) 
FormBuilderField::getSetting(string $key)
mixed nullGet a setting only, no fallback to getting field by name 
FormBuilderField::head string 
FormBuilderField::label string 
FormBuilderField::level int 
FormBuilderField::name string 
FormBuilderField::notes string 
FormBuilderField::numChildren int 
FormBuilderField::parent FormBuilderField null 
FormBuilderField::prevParent FormBuilderField null Temporary property used after field is removed only 
FormBuilderField::remove($key)
FormBuilderData thisRemove the given child from this form/field 
FormBuilderField::required bool 
FormBuilderField::requiredIf string 
FormBuilderField::set(string $key, mixed $value)
FormBuilderData thisSet a value to the field 
FormBuilderField::setArray(array $data)
(nothing)Given an array of data, populate the data to this form field 
FormBuilderField::setName(string $name)
FormBuilderDataSet field name 
FormBuilderField::showIf string 
FormBuilderField::type string 

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.236

Latest news

  • ProcessWire Weekly #522
    In the 522nd issue of ProcessWire Weekly we'll check out the latest core updates, introduce a new module called File Mover, and more. Read on!
    Weekly.pw / 11 May 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits