<?php/**
* @file
* Definition of Drupal\Core\Ajax\AlertCommand.
*/namespaceDrupal\Core\Ajax;
useDrupal\Core\Ajax\CommandInterface;
/**
* AJAX command for a javascript alert box.
*/class AlertCommandimplements CommandInterface {
/**
* The text to be displayed in the alert box.
*
* @var string
*/
protected $text;
/**
* Constructs an AlertCommand object.
*
* @param string $text
* The text to be displayed in the alert box.
*/
public function__construct($text) {
$this->text = $text;
}
/**
* Implements Drupal\Core\Ajax\CommandInterface:render().
*/
public functionrender() {
returnarray(
'command' => 'alert',
'text' => $this->text,
);
}
}