LayoutParagraphsInsertCommand.php in Layout Paragraphs 1.0.x
File
src/Ajax/LayoutParagraphsInsertCommand.php
View source
<?php
namespace Drupal\layout_paragraphs\Ajax;
use Drupal\Core\Ajax\CommandInterface;
use Drupal\Core\Ajax\CommandWithAttachedAssetsInterface;
use Drupal\Core\Ajax\CommandWithAttachedAssetsTrait;
class LayoutParagraphsInsertCommand implements CommandInterface, CommandWithAttachedAssetsInterface {
use CommandWithAttachedAssetsTrait;
protected $settings;
protected $content;
public function __construct($settings, $content) {
$this->settings = $settings;
$this->content = $content;
}
public function render() {
return [
'command' => 'layoutParagraphsInsert',
'content' => $this
->getRenderedContent(),
'settings' => $this->settings,
];
}
}