function DataCommand::__construct
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Ajax/DataCommand.php \Drupal\Core\Ajax\DataCommand::__construct()
- 10 core/lib/Drupal/Core/Ajax/DataCommand.php \Drupal\Core\Ajax\DataCommand::__construct()
- 9 core/lib/Drupal/Core/Ajax/DataCommand.php \Drupal\Core\Ajax\DataCommand::__construct()
- 8.9.x core/lib/Drupal/Core/Ajax/DataCommand.php \Drupal\Core\Ajax\DataCommand::__construct()
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 28
Class
- DataCommand
- An AJAX command for implementing jQuery's data() method.
Namespace
Drupal\Core\AjaxCode
public function __construct(protected $selector, protected $name, protected $value) {
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.