You are here

public function AnnounceCommand::render in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Ajax/AnnounceCommand.php \Drupal\Core\Ajax\AnnounceCommand::render()
  2. 9 core/lib/Drupal/Core/Ajax/AnnounceCommand.php \Drupal\Core\Ajax\AnnounceCommand::render()

File

core/lib/Drupal/Core/Ajax/AnnounceCommand.php, line 70

Class

AnnounceCommand
AJAX command for a JavaScript Drupal.announce() call.

Namespace

Drupal\Core\Ajax

Code

public function render() {
  $render = [
    'command' => 'announce',
    'text' => $this->text,
  ];
  if ($this->priority !== NULL) {
    $render['priority'] = $this->priority;
  }
  return $render;
}