This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/vendor/drupal/console/templates/module/entity-content-page.php.twig

35 lines
1,006 B
Twig
Raw Normal View History

2018-11-23 12:29:20 +00:00
{% 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 %}