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 thisAdd an Inputfield item as a child (also accepts array definition) 
InputfieldWrapper::append(Inputfield $item)
$thisAppend an Inputfield to this instance’s children. 
InputfieldWrapper::import($items)
$thisImport the given Inputfield items as children 
InputfieldWrapper::importArray(array $a)
$thisImport an array of Inputfield definitions to to this InputfieldWrapper instance 
InputfieldWrapper::insert($item, $existingItem)
$thisInsert new or existing Inputfield before or after another 
InputfieldWrapper::insertAfter($item, $existingItem)
$thisInsert one Inputfield after one that’s already there. 
InputfieldWrapper::insertBefore($item, $existingItem)
$thisInsert one Inputfield before one that’s already there. 
InputfieldWrapper::new(string $typeName)
Inputfield InputfieldSelect InputfieldWrapperCreate a new Inputfield, add it to this InputfieldWrapper, and return the new Inputfield
InputfieldWrapper::populateValues($data)
arrayPopulate values for all Inputfields in this wrapper from the given $data object or array. 
InputfieldWrapper::prepend(Inputfield $item)
$thisPrepend an Inputfield to this instance’s children. 
InputfieldWrapper::remove($key)
$thisRemove an Inputfield from this instance’s children. 

Retrieval and traversal

NameReturnSummary 
InputfieldWrapper::child()
Inputfield nullFind an Inputfield below this one that has the given name 
InputfieldWrapper::children()
InputfieldsArrayReturn all children Inputfield objects
Can also be used as property: InputfieldWrapper::children
 
InputfieldWrapper::count()
intReturn the quantity of children present 
InputfieldWrapper::find(string $selector)
InputfieldsArrayFind all children Inputfields matching a selector string 
InputfieldWrapper::get(string $key)
Inputfield mixedGet a child Inputfield having a name attribute matching the given $key. 
InputfieldWrapper::getAll()
InputfieldsArrayGet all Inputfields below this recursively in a flat InputfieldWrapper (children, and their children, etc.) 
InputfieldWrapper::getByAttr(string $attrName, string $attrValue)
Inputfield InputfieldWrapper nullGiven an attribute name and value, return the first matching Inputfield or null if not found 
InputfieldWrapper::getByField($field)
Inputfield InputfieldWrapper nullGet Inputfield by Field (hasField) 
InputfieldWrapper::getByName(string $name)
Inputfield InputfieldWrapper nullShorter alias of getChildByName() 
InputfieldWrapper::getByProperty(string $property, mixed $value)
Inputfield InputfieldWrapper null arrayGet Inputfield by some other non-attribute property or setting 
InputfieldWrapper::getChildByName(string $name)
Inputfield InputfieldWrapper nullGiven an Inputfield name, return the child Inputfield or NULL if not found. 
InputfieldWrapper::getIterator()
InputfieldsArrayEnables foreach() of the children of this class 
InputfieldWrapper::isEmpty()
boolReturns 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 InputfieldGet Inputfield objects that have errors 
InputfieldWrapper::getErrors()
arrayReturn 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.

NameReturnSummaryDefault
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.251