function template_preprocess_popup_onload in Popup On Load 8
Prepares variables for Popup On Load templates.
Default template: popup_onload.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
- ./
popup_onload.page.inc, line 22 - Contains popup_onload.page.inc.
Code
function template_preprocess_popup_onload(array &$variables) {
// Fetch PopupOnLoad Entity Object.
$popup_onload = $variables['elements']['#popup_onload'];
// Helpful $content variable for templates.
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
}