render-array.html.twig

Same filename in other branches
  1. 4.0.x modules/render_example/templates/render-array.html.twig

Default theme implementation for render_array_help.

Themes the render array help portion (from the demonstration page).

Available variables:

  • element: Element that will be rendered.
  • element['rendered'] : rendered element
  • element['unrendered'] : unrendered element
  • element['description'] : the description of this example
2 theme calls to render-array.html.twig
RenderExampleController::arrays in modules/render_example/src/Controller/RenderExampleController.php
Examples of defining content using renderable arrays.
RenderExampleController::preRender in modules/render_example/src/Controller/RenderExampleController.php
A #pre_render callback, expand array to include additional example info.

File

modules/render_example/templates/render-array.html.twig

View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for render_array_help.
  5. *
  6. * Themes the render array help portion (from the demonstration page).
  7. *
  8. * Available variables:
  9. * - element: Element that will be rendered.
  10. * - element['rendered'] : rendered element
  11. * - element['unrendered'] : unrendered element
  12. * - element['description'] : the description of this example
  13. *
  14. * @ingroup themeable
  15. */
  16. #}
  17. <div class="render_example--array">
  18. <h2>{{ element['description'] }}</h2>
  19. <h3>Rendered Element</h3>
  20. <div class="render_example--rendered">
  21. {{ element['rendered'] }}
  22. </div>
  23. <h3>Unrendered Element</h3>
  24. <pre><code class="render_example--code">{{ element['unrendered'] }}</code></pre>
  25. </div>