Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Ajax/ReplaceCommand.php \Drupal\Core\Ajax\ReplaceCommand::render()
  2. 9 core/lib/Drupal/Core/Ajax/ReplaceCommand.php \Drupal\Core\Ajax\ReplaceCommand::render()

Implements Drupal\Core\Ajax\CommandInterface:render().

Overrides InsertCommand::render

File

core/lib/Drupal/Core/Ajax/ReplaceCommand.php, line 25

Class

ReplaceCommand
AJAX command for calling the jQuery replace() method.

Namespace

Drupal\Core\Ajax

Code

public function render() {
  return [
    'command' => 'insert',
    'method' => 'replaceWith',
    'selector' => $this->selector,
    'data' => $this
      ->getRenderedContent(),
    'settings' => $this->settings,
  ];
}