template_preprocess_radios

template_preprocess_radios(&$variables)

Prepares variables for radios templates.

Default template: radios.html.twig.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #value, #options, #description, #required, #attributes, #children.

File

core/includes/form.inc, line 274
Functions for form and batch generation and processing.

Code

function template_preprocess_radios(&$variables) {
  $element = $variables['element'];
  $variables['attributes'] = array();
  if (isset($element['#id'])) {
    $variables['attributes']['id'] = $element['#id'];
  }
  if (isset($element['#attributes']['title'])) {
    $variables['attributes']['title'] = $element['#attributes']['title'];
  }
  $variables['children'] = $element['#children'];
}
doc_Drupal
2016-10-29 09:46:46
Comments
Leave a Comment

Please login to continue.