You are here

public static function BootstrapDate::preRenderBootstrapDate in Bootstrap Datepicker 8

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/BootstrapDate.php, line 49

Class

BootstrapDate
Provides a BootstrapDate form element.

Namespace

Drupal\bootstrap_datepicker\Element

Code

public static function preRenderBootstrapDate(array $element) {
  Element::setAttributes($element, [
    'id',
    'placeholder',
    'name',
    'value',
    'size',
    'required',
  ]);
  static::setAttributes($element, [
    'form-date',
  ]);
  return $element;
}