You are here

function template_preprocess_bat_event in Booking and Availability Management Tools for Drupal 8

Prepares variables for Event templates.

Default template: bat_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

modules/bat_event/bat_event.module, line 1099
Manage Events - Events store the EventValue of a Unit over a period of time.

Code

function template_preprocess_bat_event(array &$variables) {

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

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