You are here

function template_preprocess_event in Event 8

Prepares variables for Event templates.

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

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

Code

function template_preprocess_event(array &$variables) {

  // Fetch Event Entity Object.
  $event = $variables['elements']['#event'];

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