You are here

public function WebformAnnounceCommand::__construct in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Ajax/WebformAnnounceCommand.php \Drupal\webform\Ajax\WebformAnnounceCommand::__construct()

Constructs a \Drupal\webform\Ajax\ScrollTopCommand object.

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'.

File

src/Ajax/WebformAnnounceCommand.php, line 39

Class

WebformAnnounceCommand
Provides an Ajax command to trigger audio UAs to read the supplied text.

Namespace

Drupal\webform\Ajax

Code

public function __construct($text, $priority = 'polite') {
  $this->text = $text;
  $this->priority = $priority;
}