3 namespace Drupal\Core\Ajax;
6 * An AJAX command for marking HTML elements as changed.
8 * This command instructs the client to mark each of the elements matched by the
9 * given selector as 'ajax-changed'.
11 * This command is implemented by Drupal.AjaxCommands.prototype.changed()
12 * defined in misc/ajax.js.
16 class ChangedCommand implements CommandInterface {
19 * A CSS selector string.
21 * If the command is a response to a request from an #ajax form element then
22 * this value can be NULL.
29 * An optional CSS selector for elements to which asterisks will be appended.
36 * Constructs a ChangedCommand object.
38 * @param string $selector
39 * CSS selector for elements to be marked as changed.
40 * @param string $asterisk
41 * CSS selector for elements to which an asterisk will be appended.
43 public function __construct($selector, $asterisk = '') {
44 $this->selector = $selector;
45 $this->asterisk = $asterisk;
49 * Implements Drupal\Core\Ajax\CommandInterface:render().
51 public function render() {
54 'command' => 'changed',
55 'selector' => $this->selector,
56 'asterisk' => $this->asterisk,