InputfieldWrapper class

A type of Inputfield that contains other Inputfield objects as children. Commonly a form or a fieldset.

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

Show class?     Show args?       Only hookable?    

Manipulation

NameReturnSummary 
InputfieldWrapper::add($item)
Inputfield InputfieldWrapper this

Add an Inputfield item as a child (also accepts array definition)

 
InputfieldWrapper::append(Inputfield $item)
$this

Append an Inputfield to this instance’s children.

 
InputfieldWrapper::import($items)
$this

Import the given Inputfield items as children

 
InputfieldWrapper::importArray(array $a)
$this

Import an array of Inputfield definitions to to this InputfieldWrapper instance

 
InputfieldWrapper::insert($item, $existingItem)
$this

Insert new or existing Inputfield before or after another

 
InputfieldWrapper::insertAfter($item, $existingItem)
$this

Insert one Inputfield after one that’s already there.

 
InputfieldWrapper::insertBefore($item, $existingItem)
$this

Insert one Inputfield before one that’s already there.

 
InputfieldWrapper::new(string $typeName)
Inputfield InputfieldSelect InputfieldWrapper

Create a new Inputfield, add it to this InputfieldWrapper, and return the new Inputfield

InputfieldWrapper::populateValues($data)
array

Populate values for all Inputfields in this wrapper from the given $data object or array.

 
InputfieldWrapper::prepend(Inputfield $item)
$this

Prepend an Inputfield to this instance’s children.

 
InputfieldWrapper::remove($key)
$this

Remove an Inputfield from this instance’s children.

 

Retrieval and traversal

NameReturnSummary 
InputfieldWrapper::child()
Inputfield null

Find an Inputfield below this one that has the given name

 
InputfieldWrapper::children()
InputfieldsArray

Return all children Inputfield objects


Can also be used as property: InputfieldWrapper::children
 
InputfieldWrapper::count()
int

Return the quantity of children present

 
InputfieldWrapper::find(string $selector)
InputfieldsArray

Find all children Inputfields matching a selector string

 
InputfieldWrapper::get(string $key)
Inputfield mixed

Get a child Inputfield having a name attribute matching the given $key.

 
InputfieldWrapper::getAll()
InputfieldsArray

Get all Inputfields below this recursively in a flat InputfieldWrapper (children, and their children, etc.)

 
InputfieldWrapper::getByAttr(string $attrName, string $attrValue)
Inputfield InputfieldWrapper null

Given an attribute name and value, return the first matching Inputfield or null if not found

 
InputfieldWrapper::getByField($field)
Inputfield InputfieldWrapper null

Get Inputfield by Field (hasField)

 
InputfieldWrapper::getByName(string $name)
Inputfield InputfieldWrapper null

Shorter alias of getChildByName()

 
InputfieldWrapper::getByProperty(string $property, mixed $value)
Inputfield InputfieldWrapper null array

Get Inputfield by some other non-attribute property or setting

 
InputfieldWrapper::getChildByName(string $name)
Inputfield InputfieldWrapper null

Given an Inputfield name, return the child Inputfield or NULL if not found.

 
InputfieldWrapper::getIterator()
InputfieldsArray

Enables foreach() of the children of this class

 
InputfieldWrapper::isEmpty()
bool

Returns true if all children are empty, or false if one or more is populated

 

For hooks

These methods are only useful for hooking and should not be called directly.

Errors

NameReturnSummary 
InputfieldWrapper::getErrorInputfields()
array Inputfield

Get Inputfield objects that have errors

 
InputfieldWrapper::getErrors()
array

Return an array of errors that occurred on any of the children during input processing.

 

Properties

Access any common Inputfield type class name from an InputfieldWrapper and it will return a new instance of that Inputfield, i.e. $f = $inputfields->InputfieldText; Below are several examples.

NameReturnSummary 
InputfieldWrapper::InputfieldAsmSelect InputfieldAsmSelect Create new asmSelect Inputfield  
InputfieldWrapper::InputfieldButton InputfieldButton Create new button Inputfield  
InputfieldWrapper::InputfieldCKEditor InputfieldCKEditor Create new CKEditor Inputfield  
InputfieldWrapper::InputfieldCheckbox InputfieldCheckbox Create new checkbox Inputfield  
InputfieldWrapper::InputfieldCheckboxes InputfieldCheckboxes Create new checkboxes Inputfield  
InputfieldWrapper::InputfieldDatetime InputfieldDatetime Create new date/time Inputfield  
InputfieldWrapper::InputfieldEmail InputfieldEmail Create new email Inputfield  
InputfieldWrapper::InputfieldFieldset InputfieldFieldset Create new Fieldset InputfieldWrapper  
InputfieldWrapper::InputfieldFile InputfieldFile Create new file Inputfield  
InputfieldWrapper::InputfieldFloat InputfieldFloat Create new float Inputfield  
InputfieldWrapper::InputfieldForm InputfieldForm Create new form InputfieldWrapper  
InputfieldWrapper::InputfieldHidden InputfieldHidden Create new hidden Inputfield  
InputfieldWrapper::InputfieldIcon InputfieldIcon Create new icon Inputfield  
InputfieldWrapper::InputfieldImage InputfieldImage Create new image Inputfield  
InputfieldWrapper::InputfieldInteger InputfieldInteger Create new integer Inputfield  
InputfieldWrapper::InputfieldMarkup InputfieldMarkup Create new markup Inputfield  
InputfieldWrapper::InputfieldPage InputfieldPage Create new Page selection Inputfield  
InputfieldWrapper::InputfieldPageAutocomplete InputfieldPageAutocomplete Create new Page selection autocomplete Inputfield  
InputfieldWrapper::InputfieldPageListSelect InputfieldPageListSelect Create new PageListSelect Inputfield  
InputfieldWrapper::InputfieldPageListSelectMultiple InputfieldPageListSelectMultiple Create new multiple PageListSelect Inputfield  
InputfieldWrapper::InputfieldRadios InputfieldRadios Create new radio buttons Inputfield  
InputfieldWrapper::InputfieldSelect InputfieldSelect Create new <select> Inputfield  
InputfieldWrapper::InputfieldSelectMultiple InputfieldSelectMultiple Create new <select multiple> Inputfield  
InputfieldWrapper::InputfieldSubmit InputfieldSubmit Create new submit button Inputfield  
InputfieldWrapper::InputfieldText InputfieldText Create new single-line text Inputfield  
InputfieldWrapper::InputfieldTextTags InputfieldTextTags Create new text tags Inputfield  
InputfieldWrapper::InputfieldTextarea InputfieldTextarea Create new multi-line <textarea> Inputfield  
InputfieldWrapper::InputfieldToggle InputfieldToggle Create new toggle Inputfield  
InputfieldWrapper::InputfieldURL InputfieldURL Create new URL Inputfield  
InputfieldWrapper::InputfieldWrapper InputfieldWrapper Create new generic InputfieldWrapper  

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.252