class LayoutParagraphsInsertCommand in Layout Paragraphs 1.0.x
Class LayoutParagraphsStateResetCommand.
Hierarchy
- class \Drupal\layout_paragraphs\Ajax\LayoutParagraphsInsertCommand implements CommandInterface, CommandWithAttachedAssetsInterface uses CommandWithAttachedAssetsTrait
Expanded class hierarchy of LayoutParagraphsInsertCommand
1 file declares its use of LayoutParagraphsInsertCommand
- LayoutParagraphsWidget.php in src/
Plugin/ Field/ FieldWidget/ LayoutParagraphsWidget.php
File
- src/
Ajax/ LayoutParagraphsInsertCommand.php, line 12
Namespace
Drupal\layout_paragraphs\AjaxView source
class LayoutParagraphsInsertCommand implements CommandInterface, CommandWithAttachedAssetsInterface {
use CommandWithAttachedAssetsTrait;
/**
* The layout element settings array.
*
* @var array
*/
protected $settings;
/**
* The content for the matched element(s).
*
* Either a render array or an HTML string.
*
* @var string|array
*/
protected $content;
/**
* Constructs a LayoutParagraphsInsertCommand instance.
*/
public function __construct($settings, $content) {
$this->settings = $settings;
$this->content = $content;
}
/**
* Render custom ajax command.
*
* @return ajax
* Command function.
*/
public function render() {
return [
'command' => 'layoutParagraphsInsert',
'content' => $this
->getRenderedContent(),
'settings' => $this->settings,
];
}
}
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. | |
LayoutParagraphsInsertCommand:: |
protected | property | The content for the matched element(s). | |
LayoutParagraphsInsertCommand:: |
protected | property | The layout element settings array. | |
LayoutParagraphsInsertCommand:: |
public | function |
Render custom ajax command. Overrides CommandInterface:: |
|
LayoutParagraphsInsertCommand:: |
public | function | Constructs a LayoutParagraphsInsertCommand instance. |