function template_preprocess_log in Log entity 8
Same name in this branch
- 8 log.module \template_preprocess_log()
- 8 log.page.inc \template_preprocess_log()
Same name and namespace in other branches
- 2.x log.module \template_preprocess_log()
Prepares variables for Log templates.
Default template: log.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
- ./
log.page.inc, line 24 - Contains log.page.inc.
Code
function template_preprocess_log(array &$variables) {
// Fetch Log Entity Object.
$log = $variables['elements']['#log'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}