You are here

public static function YamlFormTime::preRenderYamlFormTime in YAML Form 8

Adds form-specific attributes to a 'date' #type element.

Parameters

array $element: An associative array containing the properties of the element.

Return value

array The $element with prepared variables ready for #theme 'input__time'.

File

src/Element/YamlFormTime.php, line 146

Class

YamlFormTime
Provides a form element for time selection.

Namespace

Drupal\yamlform\Element

Code

public static function preRenderYamlFormTime($element) {
  $element['#attributes']['type'] = 'time';
  Element::setAttributes($element, [
    'id',
    'name',
    'type',
    'value',
    'size',
    'min',
    'max',
    'step',
  ]);
  static::setAttributes($element, [
    'form-time',
  ]);
  return $element;
}