You are here

protected function WebformAjaxFormTrait::announce in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Form/WebformAjaxFormTrait.php \Drupal\webform\Form\WebformAjaxFormTrait::announce()

Queue announcement with Ajax response.

Parameters

string $text: A string to be read by the UA.

string $priority: A string to indicate the priority of the message. Can be either 'polite' or 'assertive'.

See also

\Drupal\Core\Ajax\AnnounceCommand

\Drupal\webform\Form\WebformAjaxFormTrait::submitAjaxForm

2 calls to WebformAjaxFormTrait::announce()
WebformAjaxFormTrait::submitAjaxForm in src/Form/WebformAjaxFormTrait.php
Submit form #ajax callback.
WebformSubmissionForm::wizardSubmit in src/WebformSubmissionForm.php
Webform submission handler for the wizard submit action.

File

src/Form/WebformAjaxFormTrait.php, line 410

Class

WebformAjaxFormTrait
Trait for webform ajax support.

Namespace

Drupal\webform\Form

Code

protected function announce($text, $priority = 'polite') {
  $announcements =& drupal_static('webform_announcements', []);
  $announcements[] = [
    'text' => $text,
    'priority' => $priority,
  ];
}