This repository has been archived on 2022-07-12. You can view files and clone it, but cannot push or open issues or pull requests.
naomi a48e37ad39 Changed name of Profile entity to Hat
so as not to conflict with Profile or Profile2 module on existing sites
2018-04-11 12:18:27 +02:00

31 lines
725 B
PHP

<?php
/**
* @file
* Contains hat.page.inc.
*
* Page callback for Hat entities.
*/
use Drupal\Core\Render\Element;
/**
* Prepares variables for Hat templates.
*
* Default template: hat.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_hat(array &$variables) {
// Fetch Hat Entity Object.
$hat = $variables['elements']['#hat'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}