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?        

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(Inputfield $item, Inputfield $existingItem)
$thisInsert one Inputfield after one that’s already there. 
InputfieldWrapper::insertBefore(Inputfield $item, Inputfield $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($item)
$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()
InputfieldWrapperGet all Inputfields below this recursively in a flat InputfieldWrapper (children, and their children, etc.) 
InputfieldWrapper::getChildByName(string $name)
Inputfield nullGiven an Inputfield name, return the child Inputfield or NULL if not found. 
InputfieldWrapper::getErrors()
arrayReturn an array of errors that occurred on any of the children during input processing. 
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 

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

Twitter updates

  • New post: This week we’ll take a look at a new version of FormBuilder that's on the way (with a screencast), as well as the latest version of the core: ProcessWire 3.0.140— More
    6 September 2019
  • We added WebP image support this year and many have been adopting it in existing projects. We look at a process used for migrating existing websites to WebP images— from preliminary considerations to implementation & testing, w/lots of tips & tricks too: More
    16 August 2019
  • Core version 3.0.137 on the dev branch adds the ability to hook multiple methods at once, in a single call. This post details how it works and provides a useful example of how you might put it to use in your development environment— More
    2 August 2019

Latest news

  • ProcessWire Weekly #279
    This week in the 279th issue of ProcessWire Weekly we're going to introduce some of the latest third party modules out there, and highlight a brand new site of the week. Read on!
    Weekly.pw / 14 September 2019
  • ProcessWire 3.0.140 and FormBuilder v40
    This week we’ll take a look at a new version of FormBuilder that's on the way (with a screencast), as well as the latest version of the core: ProcessWire 3.0.140.
    Blog / 6 September 2019
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK