You are here

function template_preprocess_webform_actions in Webform 6.x

Same name and namespace in other branches
  1. 8.5 includes/webform.theme.template.inc \template_preprocess_webform_actions()

Prepares variables for webform actions templates.

Default template: webform-actions.html.twig.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties and buttons.

See also

\Drupal\webform\WebformSubmissionForm::actionsElement

\Drupal\webform\WebformSubmissionForm::actions

File

includes/webform.theme.template.inc, line 90
Preprocessors and helper functions to make theming easier.

Code

function template_preprocess_webform_actions(array &$variables) {
  $element = $variables['element'];

  // Buttons include submit, previous, next, and draft.
  foreach (Element::children($element) as $key) {
    $variables[$key] = $element[$key];
  }
}