InsertCommand
class InsertCommand implements CommandInterface, CommandWithAttachedAssetsInterface (View source)
Generic AJAX command for inserting content.
This command instructs the client to insert the given HTML using whichever jQuery DOM manipulation method has been specified in the #ajax['method'] variable of the element that triggered the request.
This command is implemented by Drupal.AjaxCommands.prototype.insert() defined in misc/ajax.js.
Traits
Trait for Ajax commands that render content and attach assets.
Properties
| protected AttachedAssets | $attachedAssets | The attached assets for this Ajax command. |
from CommandWithAttachedAssetsTrait |
| protected string | $selector | A CSS selector string. |
|
| protected string|array | $content | The content for the matched element(s). |
|
| protected array | $settings | A settings array to be passed to any attached JavaScript behavior. |
Methods
Processes the content for output.
Gets the attached assets.
Constructs an InsertCommand object.
Implements Drupal\Core\Ajax\CommandInterface:render().
Details
protected string|MarkupInterface
getRenderedContent()
Processes the content for output.
If content is a render array, it may contain attached assets to be processed.
AttachedAssets|null
getAttachedAssets()
Gets the attached assets.
__construct(string $selector, string|array $content, array $settings = NULL)
Constructs an InsertCommand object.
render()
Implements Drupal\Core\Ajax\CommandInterface:render().