__composition.page.inc 811 B

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