You are here

function template_preprocess_opigno_answer in Opigno module 3.x

Same name and namespace in other branches
  1. 8 opigno_answer.page.inc \template_preprocess_opigno_answer()

Prepares variables for Answer templates.

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

./opigno_answer.page.inc, line 22
Contains opigno_answer.page.inc.

Code

function template_preprocess_opigno_answer(array &$variables) {

  // Fetch OpignoAnswer Entity Object.
  $opigno_answer = $variables['elements']['#opigno_answer'];

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