class BaseCommand in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Ajax/BaseCommand.php \Drupal\Core\Ajax\BaseCommand
Base command that only exists to simplify AJAX commands.
Hierarchy
- class \Drupal\Core\Ajax\BaseCommand implements CommandInterface
Expanded class hierarchy of BaseCommand
5 files declare their use of BaseCommand
- EntitySavedCommand.php in core/
modules/ quickedit/ src/ Ajax/ EntitySavedCommand.php - Contains \Drupal\quickedit\Ajax\EntitySavedCommand.
- FieldFormCommand.php in core/
modules/ quickedit/ src/ Ajax/ FieldFormCommand.php - Contains \Drupal\quickedit\Ajax\FieldFormCommand.
- FieldFormSavedCommand.php in core/
modules/ quickedit/ src/ Ajax/ FieldFormSavedCommand.php - Contains \Drupal\quickedit\Ajax\FieldFormSavedCommand.
- FieldFormValidationErrorsCommand.php in core/
modules/ quickedit/ src/ Ajax/ FieldFormValidationErrorsCommand.php - Contains \Drupal\quickedit\Ajax\FieldFormValidationErrorsCommand.
- GetUntransformedTextCommand.php in core/
modules/ editor/ src/ Ajax/ GetUntransformedTextCommand.php - Contains \Drupal\editor\Ajax\GetUntransformedTextCommand.
File
- core/
lib/ Drupal/ Core/ Ajax/ BaseCommand.php, line 13 - Contains \Drupal\Core\Ajax\BaseCommand.
Namespace
Drupal\Core\AjaxView source
class BaseCommand implements CommandInterface {
/**
* The name of the command.
*
* @var string
*/
protected $command;
/**
* The data to pass on to the client side.
*
* @var string
*/
protected $data;
/**
* Constructs a BaseCommand object.
*
* @param string $command
* The name of the command.
* @param string $data
* The data to pass on to the client side.
*/
public function __construct($command, $data) {
$this->command = $command;
$this->data = $data;
}
/**
* {@inheritdoc}
*/
public function render() {
return array(
'command' => $this->command,
'data' => $this->data,
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BaseCommand:: |
protected | property | The name of the command. | |
BaseCommand:: |
protected | property | The data to pass on to the client side. | |
BaseCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CommandInterface:: |
1 |
BaseCommand:: |
public | function | Constructs a BaseCommand object. | 5 |