popsu-d9/old.vendor/drupal/console/templates/module/entity-content-page.php.twig
2022-04-27 11:30:43 +02:00

35 lines
1006 B
Twig

{% extends "base/file.php.twig" %}
{% block file_path %}
{{ entity_name }}.page.inc{% endblock %}
{% block extra_info %}
*
* Page callback for {{ label }} entities.
{% endblock %}
{% block use_class %}
use Drupal\Core\Render\Element;
{% endblock %}
{% block file_methods %}
/**
* Prepares variables for {{ label }} templates.
*
* Default template: {{ entity_name }}.html.twig.
*
* @param array $variables
* An associative array containing:
* - elements: An associative array containing the user information and any
* - attributes: HTML attributes for the containing element.
*/
function template_preprocess_{{ entity_name | machine_name }}(array &$variables) {
// Fetch {{ entity_class }} Entity Object.
${{ entity_name | machine_name }} = $variables['elements']['#{{ entity_name }}'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}
{% endblock %}