You are here

function template_preprocess_pm_persona in Drupal PM (Project Management) 4.x

Prepares variables for Persona templates.

Default template: pm_persona.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

modules/pm_persona/pm_persona.page.inc, line 22
Contains pm_persona.page.inc.

Code

function template_preprocess_pm_persona(array &$variables) {

  // Fetch Persona Entity Object.
  $pm_persona = $variables['elements']['#pm_persona'];

  // Helpful $content variable for templates.
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
}