$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 #550
    In the 550th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a new third party module called PagefileMetadata, and more. Read on!
    Weekly.pw / 23 November 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

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull