heartbeat_stream.page.inc 828 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Contains heartbeat_stream.page.inc.
  5. *
  6. * Page callback for Heartbeat stream entities.
  7. */
  8. use Drupal\Core\Render\Element;
  9. /**
  10. * Prepares variables for Heartbeat stream templates.
  11. *
  12. * Default template: heartbeat_stream.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_stream(array &$variables) {
  20. // Fetch HeartbeatStream Entity Object.
  21. $heartbeat_stream = $variables['elements']['#heartbeat_stream'];
  22. // Helpful $content variable for templates.
  23. foreach (Element::children($variables['elements']) as $key) {
  24. $variables['content'][$key] = $variables['elements'][$key];
  25. }
  26. }