function template_preprocess_flag_list_item in Flag Lists 4.0.x
Same name and namespace in other branches
- 8 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];
}
}