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.
Common
Name | Return | Summary | |
---|---|---|---|
$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() $fieldtypes->eq($num) $fieldtypes->eq($num) | Wire null | Returns the item at the given index starting from 0, or NULL if it doesn't exist. | |
$fieldtypes->file | FieldtypeFile | ||
$fieldtypes->first() $fieldtypes->first() $fieldtypes->first() | Wire mixed bool | Returns the first item in the WireArray or boolean false if empty. | |
$fieldtypes->float | FieldtypeFloat | ||
$fieldtypes->get() $fieldtypes->get(string $key) $fieldtypes->get(string $key) | Fieldtype null | Given a Fieldtype name (or class name) return the instantiated Fieldtype module. | |
$fieldtypes->getAll() $fieldtypes->getAll() $fieldtypes->getAll() | $this | Returns all items in the WireArray (for syntax convenience) | |
$fieldtypes->getArray() $fieldtypes->getArray() $fieldtypes->getArray() | array | Below we account for all get() related functions in WireArray to preload the fieldtypes | |
$fieldtypes->getItemKey() $fieldtypes->getItemKey(Fieldtype $item) $fieldtypes->getItemKey(Fieldtype $item) | string | Per the WireArray interface, Fields are indxed by their name | |
$fieldtypes->getIterator() $fieldtypes->getIterator() $fieldtypes->getIterator() | ArrayObject Wire | Allows iteration of the WireArray. | |
$fieldtypes->getNext() $fieldtypes->getNext($item) $fieldtypes->getNext($item, $strict = true) | Wire null | Given an item, get the item that comes after it in the WireArray | |
$fieldtypes->getPrev() $fieldtypes->getPrev($item) $fieldtypes->getPrev($item, $strict = true) | Wire null | Given an item, get the item before it in the WireArray | |
$fieldtypes->getRandom() $fieldtypes->getRandom() $fieldtypes->getRandom($num = 1, $alwaysArray = false) | WireArray Wire mixed null | Get a random item from this WireArray. | |
$fieldtypes->getValues() $fieldtypes->getValues() $fieldtypes->getValues() | array Wire | Returns a regular PHP array of all values used in this WireArray. | |
$fieldtypes->image | FieldtypeImage | ||
$fieldtypes->init() $fieldtypes->init() $fieldtypes->init() | (nothing) | Construct the $fieldtypes API var (load all Fieldtype modules into it) | |
$fieldtypes->integer | FieldtypeInteger | ||
$fieldtypes->isValidItem() $fieldtypes->isValidItem($item) $fieldtypes->isValidItem($item) | bool | Per WireArray interface, items added to Fieldtypes must be Fieldtype instances | |
$fieldtypes->isValidKey() $fieldtypes->isValidKey($key) $fieldtypes->isValidKey($key) | bool | Per the WireArray interface, keys must be strings (fieldtype class names) | |
$fieldtypes->last() $fieldtypes->last() $fieldtypes->last() | Wire mixed bool | Returns the last item in the WireArray or boolean false if empty. | |
$fieldtypes->makeBlankItem() $fieldtypes->makeBlankItem() $fieldtypes->makeBlankItem() | null | Per the WireArray interface, return a blank copy | |
$fieldtypes->makeCopy() $fieldtypes->makeCopy() $fieldtypes->makeCopy() | (nothing) | ||
$fieldtypes->makeNew() $fieldtypes->makeNew() $fieldtypes->makeNew() | (nothing) | ||
$fieldtypes->module | FieldtypeModule | ||
$fieldtypes->options | FieldtypeOptions null | ||
$fieldtypes->page | FieldtypePage | ||
$fieldtypes->pageTable | FieldtypePageTable | ||
$fieldtypes->pageTitle | FieldtypePageTitle | ||
$fieldtypes->password | FieldtypePassword | ||
$fieldtypes->pop() $fieldtypes->pop() $fieldtypes->pop() | Wire mixed null | Pop an element off the end of the WireArray and return it | |
$fieldtypes->repeater | FieldtypeRepeater null | ||
$fieldtypes->selector | FieldtypeSelector null | ||
$fieldtypes->shift() $fieldtypes->shift() $fieldtypes->shift() | Wire mixed null | Shift an element off the beginning of the WireArray and return it | |
$fieldtypes->slice() $fieldtypes->slice($start) $fieldtypes->slice($start, $limit = 0) | WireArray | Get a slice of the WireArray. | |
$fieldtypes->sort() $fieldtypes->sort($properties) $fieldtypes->sort($properties, $flags = null) | $this | Sort 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