You are here

public static function HMS::preRenderHMS in HMS Field 8

Prepares a #type 'hms' render element for input.html.twig.

Parameters

array $element: An associative array containing the properties of the element. Properties used: #title, #value, #description, #size, #maxlength, #placeholder, #required, #attributes.

Return value

array The $element with prepared variables ready for input.html.twig.

File

src/Element/HMS.php, line 83
Contains \Drupal\hms_field\Element\Hmsfield.

Class

HMS
Provides a one-line text field form element.

Namespace

Drupal\hms_field\Element

Code

public static function preRenderHMS($element) {
  Element::setAttributes($element, array(
    'id',
    'name',
    'value',
    'size',
    'maxlength',
    'placeholder',
  ));
  static::setAttributes($element, array(
    'form-hms',
  ));
  return $element;
}