template_preprocess_datetime_wrapper(&$variables)
Prepares variables for datetime form wrapper templates.
Default template: datetime-wrapper.html.twig.
array $variables: An associative array containing:
function template_preprocess_datetime_wrapper(&$variables) { $element = $variables['element']; if (!empty($element['#title'])) { $variables['title'] = $element['#title']; } // Suppress error messages. $variables['errors'] = NULL; if (!empty($element['#description'])) { $variables['description'] = $element['#description']; } $variables['required'] = FALSE; // For required datetime fields 'form-required' & 'js-form-required' classes // are appended to the label attributes. if (!empty($element['#required'])) { $variables['required'] = TRUE; } $variables['content'] = $element['#children']; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!theme.inc/function/template_preprocess_datetime_wrapper/8.1.x