You are here

public static function GranularityElement::preRenderElement in Duration Field 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Element/GranularityElement.php \Drupal\duration_field\Element\GranularityElement::preRenderElement()

File

src/Element/GranularityElement.php, line 131

Class

GranularityElement
Provides the Granularity form element.

Namespace

Drupal\duration_field\Element

Code

public static function preRenderElement(array $element) {

  // Set the wrapper as a container to the inner values.
  $element['#attributes']['type'] = 'container';
  Element::setAttributes($element, [
    'id',
    'name',
    'value',
  ]);
  static::setAttributes($element, [
    'form-granularity',
  ]);
  return $element;
}