public static function Nif::preRenderNif in Field NIF 8
Prepares a #type 'nif' render element for input.html.twig.
Parameters
array $element: An associative array containing the properties of the element.
Return value
array The $element with prepared variables ready for input.html.twig.
File
- src/
Element/ Nif.php, line 107
Class
- Nif
- Provides a NIF/NIE/CIF render element.
Namespace
Drupal\field_nif\ElementCode
public static function preRenderNif($element) {
$element['#attributes']['type'] = 'nif';
Element::setAttributes($element, [
'id',
'name',
'value',
'size',
'maxlength',
'placeholder',
'supported_types',
]);
static::setAttributes($element, [
'form-nif',
]);
return $element;
}