You are here

function template_preprocess_log in Log entity 2.x

Same name and namespace in other branches
  1. 8 log.module \template_preprocess_log()
  2. 8 log.page.inc \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 log information and any fields attached to the log. Properties used:

  • attributes: HTML attributes for the containing element.

File

./log.module, line 67
Hooks and customizations for the log module.

Code

function template_preprocess_log(&$variables) {
  $variables['log'] = $variables['elements']['#log'];

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