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

Twitter updates

  • New post: ProcessWire 3.0.131 adds support for partial/resumable downloads and http stream delivery, and contains several updates to our comments system, among other updates— More
    3 May 2019
  • New post: Quietly and without interruption this week, the ProcessWire.com website (and all subdomains) moved from a single static server to a load-balanced multi-server environment, giving us even more horsepower and redundancy than before— More
    19 April 2019
  • New post: With ProcessWire 3.0.130, this week we’ll take a detailed look at a few useful new API additions made in the last few weeks, along with examples of each—More
    12 April 2019

Latest news

  • ProcessWire Weekly #262
    The 262nd issue of ProcessWire Weekly will cover the latest module updates, both Pro modules and non-commercial ones. We've also got some highlights from the support forum, and a beautiful new site of the week. Read on!
    Weekly.pw / 18 May 2019
  • Lots of module updates
    In this post we take a quick look at the new version of ProFields Repeater Matrix, yet another new version of FormBuilder, and a new version of the GoogleClientAPI module.
    Blog / 17 May 2019
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer