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

Latest news

  • ProcessWire Weekly #518
    The 518th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 13 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 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.