public function DataCommand::__construct

public DataCommand::__construct($selector, $name, $value)

Constructs a DataCommand object.

Parameters

string $selector: A CSS selector for the elements to which the data will be attached.

string $name: The key of the data to be attached to elements matched by the selector.

mixed $value: The value of the data to be attached to elements matched by the selector.

File

core/lib/Drupal/Core/Ajax/DataCommand.php, line 54

Class

DataCommand
An AJAX command for implementing jQuery's data() method.

Namespace

Drupal\Core\Ajax

Code

public function __construct($selector, $name, $value) {
  $this->selector = $selector;
  $this->name = $name;
  $this->value = $value;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Ajax!DataCommand.php/function/DataCommand::__construct/8.1.x