You are here

public function Measurement::getInfo in Physical Fields 8

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides ElementInterface::getInfo

File

src/Element/Measurement.php, line 32

Class

Measurement
Provides a measurement form element.

Namespace

Drupal\physical\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#measurement_type' => NULL,
    // All units are available by default.
    '#available_units' => [],
    '#size' => 10,
    '#maxlength' => 128,
    '#default_value' => NULL,
    '#attached' => [
      'library' => [
        'physical/admin',
      ],
    ],
    '#process' => [
      [
        $class,
        'processElement',
      ],
      [
        $class,
        'processAjaxForm',
      ],
      [
        $class,
        'processGroup',
      ],
    ],
    '#pre_render' => [
      [
        $class,
        'preRenderGroup',
      ],
    ],
    '#input' => TRUE,
    '#theme_wrappers' => [
      'container',
    ],
  ];
}