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 
InputfieldWrapper::InputfieldAsmSelect InputfieldAsmSelect 
InputfieldWrapper::InputfieldButton InputfieldButton 
InputfieldWrapper::InputfieldCheckbox InputfieldCheckbox 
InputfieldWrapper::InputfieldCheckboxes InputfieldCheckboxes 
InputfieldWrapper::InputfieldCkeditor InputfieldCKEditor 
InputfieldWrapper::InputfieldCommentsAdmin InputfieldCommentsAdmin 
InputfieldWrapper::InputfieldDatetime InputfieldDatetime 
InputfieldWrapper::InputfieldEmail InputfieldEmail 
InputfieldWrapper::InputfieldFieldset InputfieldFieldset 
InputfieldWrapper::InputfieldFieldsetOpen InputfieldFieldsetOpen 
InputfieldWrapper::InputfieldFieldsetTabOpen InputfieldFieldsetTabOpen 
InputfieldWrapper::InputfieldFile InputfieldFile 
InputfieldWrapper::InputfieldFloat InputfieldFloat 
InputfieldWrapper::InputfieldForm InputfieldForm 
InputfieldWrapper::InputfieldHidden InputfieldHidden 
InputfieldWrapper::InputfieldIcon InputfieldIcon 
InputfieldWrapper::InputfieldImage InputfieldImage 
InputfieldWrapper::InputfieldInteger InputfieldInteger 
InputfieldWrapper::InputfieldMarkup InputfieldMarkup 
InputfieldWrapper::InputfieldName InputfieldName 
InputfieldWrapper::InputfieldPage InputfieldPage 
InputfieldWrapper::InputfieldPageAutocomplete InputfieldPageAutocomplete 
InputfieldWrapper::InputfieldPageListSelect InputfieldPageListSelect 
InputfieldWrapper::InputfieldPageListSelectMultiple InputfieldPageListSelectMultiple 
InputfieldWrapper::InputfieldPageName InputfieldPageName 
InputfieldWrapper::InputfieldPageTable InputfieldPageTable 
InputfieldWrapper::InputfieldPageTitle InputfieldPageTitle 
InputfieldWrapper::InputfieldPassword InputfieldPassword 
InputfieldWrapper::InputfieldRadios InputfieldRadios 
InputfieldWrapper::InputfieldRepeater InputfieldRepeater 
InputfieldWrapper::InputfieldSelect InputfieldSelect 
InputfieldWrapper::InputfieldSelectMultiple InputfieldSelectMultiple 
InputfieldWrapper::InputfieldSelector InputfieldSelector 
InputfieldWrapper::InputfieldSubmit InputfieldSubmit 
InputfieldWrapper::InputfieldText InputfieldText 
InputfieldWrapper::InputfieldTextTags InputfieldTextTags 
InputfieldWrapper::InputfieldTextarea InputfieldTextarea 
InputfieldWrapper::InputfieldToggle InputfieldToggle 
InputfieldWrapper::InputfieldURL InputfieldURL 
InputfieldWrapper::InputfieldWrapper InputfieldWrapper 
InputfieldWrapper::InputfieldlFieldsetClose InputfieldFieldsetClose 
InputfieldWrapper::getValueByName(string $name)
mixedGet value of Inputfield by name 
InputfieldWrapper::insert($item, $existingItem)
$thisInsert new or existing Inputfield before or after another 
InputfieldWrapper::wired()
(nothing)Wired to API 

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::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::getByName(string $name)
Inputfield InputfieldWrapper nullShorter alias of getChildByName() 
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 

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. 

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

Latest news

  • ProcessWire Weekly #554
    In the 554th issue of ProcessWire Weekly we'll check out the latest core updates, introduce a couple of new third party modules, and more. Read on!
    Weekly.pw / 21 December 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.