class AlertCommand in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Ajax/AlertCommand.php \Drupal\Core\Ajax\AlertCommand
AJAX command for a javascript alert box.
Hierarchy
- class \Drupal\Core\Ajax\AlertCommand implements CommandInterface
Expanded class hierarchy of AlertCommand
Related topics
6 files declare their use of AlertCommand
- AjaxCommandsTest.php in core/
tests/ Drupal/ Tests/ Core/ Ajax/ AjaxCommandsTest.php - Contains \Drupal\Tests\Core\Ajax\AjaxCommandsTest.
- AjaxRenderer.php in core/
lib/ Drupal/ Core/ Render/ MainContent/ AjaxRenderer.php - Contains \Drupal\Core\Render\MainContent\AjaxRenderer.
- AjaxTestController.php in core/
modules/ system/ tests/ modules/ ajax_test/ src/ Controller/ AjaxTestController.php - Contains \Drupal\ajax_test\Controller\AjaxTestController.
- CommandsTest.php in core/
modules/ system/ src/ Tests/ Ajax/ CommandsTest.php - Contains \Drupal\system\Tests\Ajax\CommandsTest.
- FormAjaxResponseBuilderTest.php in core/
tests/ Drupal/ Tests/ Core/ Form/ FormAjaxResponseBuilderTest.php - Contains \Drupal\Tests\Core\Form\FormAjaxResponseBuilderTest.
File
- core/
lib/ Drupal/ Core/ Ajax/ AlertCommand.php, line 15 - Contains \Drupal\Core\Ajax\AlertCommand.
Namespace
Drupal\Core\AjaxView source
class AlertCommand implements 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 function render() {
return array(
'command' => 'alert',
'text' => $this->text,
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AlertCommand:: |
protected | property | The text to be displayed in the alert box. | |
AlertCommand:: |
public | function |
Implements Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface:: |
|
AlertCommand:: |
public | function | Constructs an AlertCommand object. |