function Htmx::preserve
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Htmx/Htmx.php \Drupal\Core\Htmx\Htmx::preserve()
Creates a `data-hx-preserve` attribute.
This attribute instructs HTMX that matching elements should be kept unchanged between requests. Depends on an unchanging id property on the element.
Return value
static Returns this object to allow chaining methods.
See also
https://htmx.org/attributes/hx-preserve/
File
-
core/
lib/ Drupal/ Core/ Htmx/ Htmx.php, line 1164
Class
- Htmx
- Presents the HTMX controls for developers to use with render arrays.
Namespace
Drupal\Core\HtmxCode
public function preserve() : static {
$this->createBooleanAttribute('hx-preserve', TRUE);
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.