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?        

Common

NameReturnSummary 
InputfieldAsmSelect InputfieldAsmSelect 
InputfieldButton InputfieldButton 
InputfieldCheckbox InputfieldCheckbox 
InputfieldCheckboxes InputfieldCheckboxes 
InputfieldCkeditor InputfieldCKEditor 
InputfieldCommentsAdmin InputfieldCommentsAdmin 
InputfieldDatetime InputfieldDatetime 
InputfieldEmail InputfieldEmail 
InputfieldFieldset InputfieldFieldset 
InputfieldFieldsetOpen InputfieldFieldsetOpen 
InputfieldFieldsetTabOpen InputfieldFieldsetTabOpen 
InputfieldFile InputfieldFile 
InputfieldFloat InputfieldFloat 
InputfieldForm InputfieldForm 
InputfieldHidden InputfieldHidden 
InputfieldIcon InputfieldIcon 
InputfieldImage InputfieldImage 
InputfieldInteger InputfieldInteger 
InputfieldMarkup InputfieldMarkup 
InputfieldName InputfieldName 
InputfieldPage InputfieldPage 
InputfieldPageAutocomplete InputfieldPageAutocomplete 
InputfieldPageListSelect InputfieldPageListSelect 
InputfieldPageListSelectMultiple InputfieldPageListSelectMultiple 
InputfieldPageName InputfieldPageName 
InputfieldPageTable InputfieldPageTable 
InputfieldPageTitle InputfieldPageTitle 
InputfieldPassword InputfieldPassword 
InputfieldRadios InputfieldRadios 
InputfieldRepeater InputfieldRepeater 
InputfieldSelect InputfieldSelect 
InputfieldSelectMultiple InputfieldSelectMultiple 
InputfieldSelector InputfieldSelector 
InputfieldSubmit InputfieldSubmit 
InputfieldText InputfieldText 
InputfieldTextTags InputfieldTextTags 
InputfieldTextarea InputfieldTextarea 
InputfieldToggle InputfieldToggle 
InputfieldURL InputfieldURL 
InputfieldWrapper InputfieldWrapper 
InputfieldlFieldsetClose InputfieldFieldsetClose 
getValueByName(string $name)
mixedGet value of Inputfield by name 
wired()
(nothing)Wired to API 

Manipulation

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

Retrieval and traversal

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

Errors

NameReturnSummary 
getErrorInputfields()
array InputfieldGet Inputfield objects that have errors 
getErrors()
arrayReturn an array of errors that occurred on any of the children during input processing. 

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

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer