You are here

function template_preprocess_poll_results in Poll 8

Implements template_preprocess_HOOK() for poll-results.html.twig.

Parameters

array $variables: An associative array containing:

  • raw_title: A string for the title of the poll.
  • results: The results of the poll.
  • votes: The total results in the poll.
  • block: A boolean to define if the poll is a block.
  • nid: The node ID of the poll.
  • vote: The choice number of the current user's vote.

The raw_* inputs to this are naturally unsafe; often safe versions are made to simply overwrite the raw version, but in this case it seems likely that the title and the links may be overridden by the theme layer, so they are left in with a different name for that purpose.

See also

poll-results.html.twig

File

./poll.module, line 191
Collects votes on different topics in the form of multiple choice questions.

Code

function template_preprocess_poll_results(&$variables) {
  $variables['question'] = $variables['raw_question'];
  $variables['results_title'] = t('Results');
}