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