function InsertCommand::__construct

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Ajax/InsertCommand.php \Drupal\Core\Ajax\InsertCommand::__construct()
  2. 10 core/lib/Drupal/Core/Ajax/InsertCommand.php \Drupal\Core\Ajax\InsertCommand::__construct()
  3. 11.x core/lib/Drupal/Core/Ajax/InsertCommand.php \Drupal\Core\Ajax\InsertCommand::__construct()

Constructs an InsertCommand object.

Parameters

string $selector: A CSS selector.

string|array $content: The content that will be inserted in the matched element(s), either a render array or an HTML string.

array $settings: An array of JavaScript settings to be passed to any attached behaviors.

File

core/lib/Drupal/Core/Ajax/InsertCommand.php, line 58

Class

InsertCommand
Generic AJAX command for inserting content.

Namespace

Drupal\Core\Ajax

Code

public function __construct($selector, $content, array $settings = NULL) {
    $this->selector = $selector;
    $this->content = $content;
    $this->settings = $settings;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.