You are here

public function Nif::getInfo in Field NIF 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 Textfield::getInfo

File

src/Element/Nif.php, line 44

Class

Nif
Provides a NIF/NIE/CIF render element.

Namespace

Drupal\field_nif\Element

Code

public function getInfo() {
  $class = get_class($this);
  return [
    '#input' => TRUE,
    '#default_value' => NULL,
    '#size' => 12,
    '#maxlength' => 10,
    '#supported_types' => [
      'nif',
      'nie',
      'cif',
    ],
    '#process' => [
      [
        $class,
        'processAutocomplete',
      ],
      [
        $class,
        'processAjaxForm',
      ],
      [
        $class,
        'processGroup',
      ],
    ],
    '#element_validate' => [
      [
        $class,
        'validateNif',
      ],
    ],
    '#pre_render' => [
      [
        $class,
        'preRenderTextfield',
      ],
    ],
    '#theme' => 'input__textfield',
    '#theme_wrappers' => [
      'form_element',
    ],
  ];
}