class InsertViewCommand in Advanced Insert View 8
Same name and namespace in other branches
- 2.0.x src/Ajax/InsertViewCommand.php \Drupal\insert_view_adv\Ajax\InsertViewCommand
AJAX command for inserting an embedded item in an editor.
Hierarchy
- class \Drupal\insert_view_adv\Ajax\InsertViewCommand implements CommandInterface, CommandWithAttachedAssetsInterface uses CommandWithAttachedAssetsTrait
Expanded class hierarchy of InsertViewCommand
1 file declares its use of InsertViewCommand
- AdvancedInsertViewController.php in src/
Controller/ AdvancedInsertViewController.php
File
- src/
Ajax/ InsertViewCommand.php, line 14
Namespace
Drupal\insert_view_adv\AjaxView source
class InsertViewCommand implements CommandInterface, CommandWithAttachedAssetsInterface {
use CommandWithAttachedAssetsTrait;
/**
* The content for the matched element(s).
*
* Either a render array or an HTML string.
*
* @var string|array
*/
protected $content;
/**
* Constructs an EmbedInsertCommand object.
*
* @param string|array $content
* The content that will be inserted in the matched element(s), either a
* render array or an HTML string.
*/
public function __construct($content) {
$this->content = $content;
}
/**
* {@inheritdoc}
*/
public function render() {
return [
'command' => 'insert_view_adv_insert',
'data' => $this
->getRenderedContent(),
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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. | |
InsertViewCommand:: |
protected | property | The content for the matched element(s). | |
InsertViewCommand:: |
public | function |
Return an array to be run through json_encode and sent to the client. Overrides CommandInterface:: |
|
InsertViewCommand:: |
public | function | Constructs an EmbedInsertCommand object. |