You are here

function template_preprocess_yamlform_composite_contact in YAML Form 8

Prepares variables for contact composite element templates.

Default template: yamlform-element-contact.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 639
Preprocessors and helper functions to make theming easier.

Code

function template_preprocess_yamlform_composite_contact(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;
}