function Htmx::sync
Creates a `data-hx-sync` attribute.
This attribute instructs HTMX to synchronize AJAX requests between multiple elements.
Parameters
string $selector: A CSS selector followed by a strategy.
Return value
static Returns this object to allow chaining methods.
See also
https://htmx.org/attributes/hx-sync/
File
-
core/
lib/ Drupal/ Core/ Htmx/ Htmx.php, line 1236
Class
- Htmx
- Presents the HTMX controls for developers to use with render arrays.
Namespace
Drupal\Core\HtmxCode
public function sync(string $selector) : static {
$this->createStringAttribute('hx-sync', $selector);
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.