You are here

function template_preprocess_status in Heartbeat 8

Prepares variables for Status templates.

Default template: status.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/statusmessage/status.page.inc, line 24
Contains status.page.inc.

Code

function template_preprocess_status(array &$variables) {

  // Fetch Status Entity Object.
  $status = $variables['elements']['#status'];

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