$fieldsfindByType()

Find fields by type

Available since version 3.0.194.

Usage

// basic usage
$array = $fields->findByType($type);

// usage with all arguments
$array = $fields->findByType($type, array $options = []);

Arguments

NameType(s)Description
$typestring Fieldtype

Fieldtype class name or object

$options (optional)array
  • inherit (bool): Also find types that inherit from given type? Default:true
  • valueType (string): Value type to return, one of 'field', 'id', or 'name' Default:'field'
  • indexType (string): Index type to use, one of 'name', 'id', or '' blank for non-associative array Default:'name'

Return value

array Field

[]


$fields methods and properties

API reference based on ProcessWire core version 3.0.251