3 namespace Drupal\Core\Ajax;
6 * AJAX command for calling the jQuery replace() method.
8 * The 'insert/replaceWith' command instructs the client to use jQuery's
9 * replaceWith() method to replace each element matched by the given selector
10 * with the given HTML.
12 * This command is implemented by Drupal.AjaxCommands.prototype.insert()
13 * defined in misc/ajax.js.
16 * @link http://docs.jquery.com/Manipulation/replaceWith#content jQuery replaceWith command @endlink
20 class ReplaceCommand extends InsertCommand {
23 * Implements Drupal\Core\Ajax\CommandInterface:render().
25 public function render() {
28 'command' => 'insert',
29 'method' => 'replaceWith',
30 'selector' => $this->selector,
31 'data' => $this->getRenderedContent(),
32 'settings' => $this->settings,