heartbeat.page.inc 773 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Contains heartbeat.page.inc.
  5. *
  6. * Page callback for Heartbeat entities.
  7. */
  8. use Drupal\Core\Render\Element;
  9. /**
  10. * Prepares variables for Heartbeat templates.
  11. *
  12. * Default template: heartbeat.html.twig.
  13. *
  14. * @param array $variables
  15. * An associative array containing:
  16. * - elements: An associative array containing the user information and any
  17. * - attributes: HTML attributes for the containing element.
  18. */
  19. function template_preprocess_heartbeat(array &$variables) {
  20. // Fetch Heartbeat Entity Object.
  21. $heartbeat = $variables['elements']['#heartbeat'];
  22. // Helpful $content variable for templates.
  23. foreach (Element::children($variables['elements']) as $key) {
  24. $variables['content'][$key] = $variables['elements'][$key];
  25. }
  26. }