Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / templates / module / entity-content-page.php.twig
1 {% extends "base/file.php.twig" %}
2
3 {% block file_path %}
4 {{ entity_name }}.page.inc{% endblock %}
5 {% block extra_info %}
6  *
7  * Page callback for {{ label }} entities.
8 {% endblock %}
9
10 {% block use_class %}
11 use Drupal\Core\Render\Element;
12 {% endblock %}
13
14 {% block file_methods %}
15 /**
16  * Prepares variables for {{ label }} templates.
17  *
18  * Default template: {{ entity_name }}.html.twig.
19  *
20  * @param array $variables
21  *   An associative array containing:
22  *   - elements: An associative array containing the user information and any
23  *   - attributes: HTML attributes for the containing element.
24  */
25 function template_preprocess_{{ entity_name | machine_name }}(array &$variables) {
26   // Fetch {{ entity_class }} Entity Object.
27   ${{ entity_name | machine_name }} = $variables['elements']['#{{ entity_name }}'];
28
29   // Helpful $content variable for templates.
30   foreach (Element::children($variables['elements']) as $key) {
31     $variables['content'][$key] = $variables['elements'][$key];
32   }
33 }
34 {% endblock %}