class AjaxTestCommandReturnPromise in Drupal 10
Test Ajax command.
Hierarchy
- class \Drupal\Core\Ajax\InsertCommand implements CommandInterface, CommandWithAttachedAssetsInterface uses CommandWithAttachedAssetsTrait
- class \Drupal\Core\Ajax\AppendCommand
- class \Drupal\ajax_test\Ajax\AjaxTestCommandReturnPromise
- class \Drupal\Core\Ajax\AppendCommand
Expanded class hierarchy of AjaxTestCommandReturnPromise
1 file declares its use of AjaxTestCommandReturnPromise
- AjaxTestFormPromise.php in core/
modules/ system/ tests/ modules/ ajax_test/ src/ Form/ AjaxTestFormPromise.php
File
- core/
modules/ system/ tests/ modules/ ajax_test/ src/ Ajax/ AjaxTestCommandReturnPromise.php, line 10
Namespace
Drupal\ajax_test\AjaxView source
class AjaxTestCommandReturnPromise extends AppendCommand {
/**
* Implements Drupal\Core\Ajax\CommandInterface:render().
*/
public function render() {
return [
'command' => 'ajaxCommandReturnPromise',
'method' => 'append',
'selector' => $this->selector,
'data' => $this
->getRenderedContent(),
'settings' => $this->settings,
];
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AjaxTestCommandReturnPromise:: |
public | function |
Implements Drupal\Core\Ajax\CommandInterface:render(). Overrides AppendCommand:: |
|
CommandWithAttachedAssetsTrait:: |
protected | property | The attached assets for this Ajax command. | |
CommandWithAttachedAssetsTrait:: |
public | function | Gets the attached assets. | |
CommandWithAttachedAssetsTrait:: |
protected | function | Processes the content for output. | |
InsertCommand:: |
protected | property | The content for the matched element(s). | |
InsertCommand:: |
protected | property | A CSS selector string. | |
InsertCommand:: |
protected | property | A settings array to be passed to any attached JavaScript behavior. | |
InsertCommand:: |
public | function | Constructs an InsertCommand object. |