You are here

function template_preprocess_flagging_collection in Flag Lists 8

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

Prepares variables for Flagging collection templates.

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

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

Code

function template_preprocess_flagging_collection(array &$variables) {

  // Fetch FlaggingCollection Entity Object.
  $flagging_collection = $variables['elements']['#flagging_collection'];

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