FieldtypeRepeaterMatrix::getMatrixTypesInfo()

Get all information available for each matrix type in an array of arrays indexed by type name

Note: it is preferable to use use RepeaterMatrixField::getMaxMatrixTypes() instead.

Unless only a specific property is requested (via the get option), returned array includes the following:

  • type (int): Type number
  • name (string): Matrix type name
  • prefix (string): Prefix used in identifying this type’s settings in the Field object
  • label (string): Matrix type label
  • label123… (string): Matrix type label per-language (if multi-language) where “123…” is language ID, for all languages.
  • sort (int): Sort value
  • file (string): Optional PHP render file (whether it exists or not)
  • head (string): Optional definition for item headers
  • field (Field): Field that these matrix types are for
  • fields (array): Array of Field objects used by this matrix type (in template context), indexed by Field name
  • fieldIDs (array): Array of Field IDs used by this matrix type

If a specific property is requested (via the get option) then returned array is of strings or ints, depending on what was requested. If the type option is used then the returned array wil be only info for that type, or if combined with the get option then return value is just the property for that type (int or string).

A blank array or null is returned if you asked for something that isn’t there.

Usage

// basic usage
$array = $fieldtypeRepeaterMatrix->getMatrixTypesInfo();

// usage with all arguments
$array = $fieldtypeRepeaterMatrix->getMatrixTypesInfo($field = null, array $options = []);

Arguments

NameType(s)Description
$field (optional)Field null
$options (optional)array
  • get (string): Optionally specify a single property to get for each item rather than everything Default:''
  • type (string|int): Get info only for this type rather than all Default:''
  • index (string): What property to use for array index, can be 'type' (number) or 'name' Default:'name'

Return value

array string null


FieldtypeRepeaterMatrix methods and properties

API reference based on ProcessWire core version 3.0.259