$fieldtypes API variable / Fieldtypes class

Maintains a collection of Fieldtype modules.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Fieldtypes class also inherits all the methods and properties of: WireArray and Wire.

Show $var?             Show args?        

Common

NameReturnSummary 
$fieldtypes->FieldtypeCheckbox FieldtypeCheckbox 
$fieldtypes->FieldtypeComments FieldtypeComments null 
$fieldtypes->FieldtypeDatetime FieldtypeDatetime 
$fieldtypes->FieldtypeEmail FieldtypeEmail 
$fieldtypes->FieldtypeFile FieldtypeFile 
$fieldtypes->FieldtypeFloat FieldtypeFloat 
$fieldtypes->FieldtypeImage FieldtypeImage 
$fieldtypes->FieldtypeInteger FieldtypeInteger 
$fieldtypes->FieldtypeModule FieldtypeModule 
$fieldtypes->FieldtypeOptions FieldtypeOptions null 
$fieldtypes->FieldtypePage FieldtypePage 
$fieldtypes->FieldtypePageTable FieldtypePageTable 
$fieldtypes->FieldtypePageTitle FieldtypePageTitle 
$fieldtypes->FieldtypePassword FieldtypePassword 
$fieldtypes->FieldtypeRepeater FieldtypeRepeater null 
$fieldtypes->FieldtypeSelector FieldtypeSelector null 
$fieldtypes->FieldtypeText FieldtypeText 
$fieldtypes->FieldtypeTextarea FieldtypeTextarea 
$fieldtypes->FieldtypeToggle FieldtypeToggle null 
$fieldtypes->FieldtypeURL FieldtypeURL 
$fieldtypes->URL FieldtypeURL 
$fieldtypes->checkbox FieldtypeCheckbox 
$fieldtypes->comments FieldtypeComments null 
$fieldtypes->datetime FieldtypeDatetime 
$fieldtypes->email FieldtypeEmail 
$fieldtypes->eq($num)
Wire nullReturns the item at the given index starting from 0, or NULL if it doesn't exist. 
$fieldtypes->file FieldtypeFile 
$fieldtypes->first()
Wire mixed boolReturns the first item in the WireArray or boolean false if empty. 
$fieldtypes->float FieldtypeFloat 
$fieldtypes->get(string $key)
Fieldtype nullGiven a Fieldtype name (or class name) return the instantiated Fieldtype module. 
$fieldtypes->getAll()
$thisReturns all items in the WireArray (for syntax convenience) 
$fieldtypes->getArray()
arrayBelow we account for all get() related functions in WireArray to preload the fieldtypes 
$fieldtypes->getItemKey(Fieldtype $item)
stringPer the WireArray interface, Fields are indxed by their name 
$fieldtypes->getIterator()
ArrayObject WireAllows iteration of the WireArray. 
$fieldtypes->getNext($item)
Wire nullGiven an item, get the item that comes after it in the WireArray 
$fieldtypes->getPrev($item)
Wire nullGiven an item, get the item before it in the WireArray 
$fieldtypes->getRandom()
WireArray Wire mixed nullGet a random item from this WireArray. 
$fieldtypes->getValues()
array WireReturns a regular PHP array of all values used in this WireArray. 
$fieldtypes->image FieldtypeImage 
$fieldtypes->init()
(nothing)Construct the $fieldtypes API var (load all Fieldtype modules into it) 
$fieldtypes->integer FieldtypeInteger 
$fieldtypes->isValidItem($item)
boolPer WireArray interface, items added to Fieldtypes must be Fieldtype instances 
$fieldtypes->isValidKey($key)
boolPer the WireArray interface, keys must be strings (fieldtype class names) 
$fieldtypes->last()
Wire mixed boolReturns the last item in the WireArray or boolean false if empty. 
$fieldtypes->makeBlankItem()
nullPer the WireArray interface, return a blank copy 
$fieldtypes->makeCopy()
(nothing) 
$fieldtypes->makeNew()
(nothing) 
$fieldtypes->module FieldtypeModule 
$fieldtypes->options FieldtypeOptions null 
$fieldtypes->page FieldtypePage 
$fieldtypes->pageTable FieldtypePageTable 
$fieldtypes->pageTitle FieldtypePageTitle 
$fieldtypes->password FieldtypePassword 
$fieldtypes->pop()
Wire mixed nullPop an element off the end of the WireArray and return it 
$fieldtypes->repeater FieldtypeRepeater null 
$fieldtypes->selector FieldtypeSelector null 
$fieldtypes->shift()
Wire mixed nullShift an element off the beginning of the WireArray and return it 
$fieldtypes->slice($start)
WireArrayGet a slice of the WireArray. 
$fieldtypes->sort($properties)
$thisSort this WireArray by the given properties. 
$fieldtypes->text FieldtypeText 
$fieldtypes->textarea FieldtypeTextarea 
$fieldtypes->toggle FieldtypeToggle null 

Additional methods and properties

In addition to the methods and properties above, Fieldtypes also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #560
    In the 560th issue of ProcessWire Weekly we'll check out the latest core updates, cover newly released ProcessWire modules, and more. Read on!
    Weekly.pw / 1 February 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • 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.