You are here

function template_preprocess_conditional_field in Conditional Fields 4.x

Same name and namespace in other branches
  1. 8 conditional_field.page.inc \template_preprocess_conditional_field()

Prepares variables for Conditional field templates.

Default template: conditional_field.html.twig.

Parameters

array $variables: An associative array containing:

  • elements: An associative array containing the user information and any
  • attributes: HTML attributes for the containing element.

File

./conditional_field.page.inc, line 22
Contains conditional_field.page.inc..

Code

function template_preprocess_conditional_field(array &$variables) {

  // Helpful $content variable for templates.
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
}