You are here

function template_preprocess_yamlform_composite_name in YAML Form 8

Prepares variables for name composite element templates.

Default template: yamlform-element-name.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.

File

includes/yamlform.theme.inc, line 696
Preprocessors and helper functions to make theming easier.

Code

function template_preprocess_yamlform_composite_name(array &$variables) {
  $element = $variables['element'];
  foreach (Element::children($element) as $key) {
    if ($element[$key]['#access']) {
      $variables['content'][$key] = $element[$key];
    }
  }
  $variables['flexbox'] = isset($element['#flexbox']) ? $element['#flexbox'] : FALSE;
}