comparison core/lib/Drupal/Core/Ajax/ReplaceCommand.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Core\Ajax;
4
5 /**
6 * AJAX command for calling the jQuery replace() method.
7 *
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.
11 *
12 * This command is implemented by Drupal.AjaxCommands.prototype.insert()
13 * defined in misc/ajax.js.
14 *
15 * See
16 * @link http://docs.jquery.com/Manipulation/replaceWith#content jQuery replaceWith command @endlink
17 *
18 * @ingroup ajax
19 */
20 class ReplaceCommand extends InsertCommand {
21
22 /**
23 * Implements Drupal\Core\Ajax\CommandInterface:render().
24 */
25 public function render() {
26
27 return [
28 'command' => 'insert',
29 'method' => 'replaceWith',
30 'selector' => $this->selector,
31 'data' => $this->getRenderedContent(),
32 'settings' => $this->settings,
33 ];
34 }
35
36 }