You are here

function template_preprocess_flag_list_item in Flag Lists 8

Same name and namespace in other branches
  1. 4.0.x flag_list_item.page.inc \template_preprocess_flag_list_item()

Prepares variables for Flag list item templates.

Default template: flag_list_item.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

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

Code

function template_preprocess_flag_list_item(array &$variables) {

  // Fetch FlagListItem Entity Object.
  $flag_list_item = $variables['elements']['#flag_list_item'];

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