template_preprocess_datetime_wrapper(&$variables)
Prepares variables for datetime form wrapper templates.
Default template: datetime-wrapper.html.twig.
Parameters
array $variables: An associative array containing:
- element: An associative array containing the properties of the element. Properties used: #title, #children, #required, #attributes.
File
- core/includes/theme.inc, line 569
- The theme system, which controls the output of Drupal.
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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' ]; } |
Please login to continue.