function template_preprocess_simplemeta in Simple Meta 8
Same name and namespace in other branches
- 8.2 simplemeta.page.inc \template_preprocess_simplemeta()
Prepares variables for SimpleMeta templates.
Default template: simplemeta.html.twig.
Parameters
array $variables: An associative array containing:
- elements: An associative array containing the user information and any
- attributes: HTML attributes for the containing element.
File
- ./
simplemeta.page.inc, line 22 - Contains simplemeta.page.inc.
Code
function template_preprocess_simplemeta(array &$variables) {
// Fetch SimplemetaEntity Entity Object.
$simplemeta = $variables['elements']['#simplemeta'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}