function Htmx::history

Creates a `data-hx-history` attribute.

The attribute value is set to false. This attribute prevents sensitive data from being saved to the localStorage cache when htmx takes a snapshot of the page state. This attribute is effective when set on any element in the current document, or any html fragment loaded into the current document by htmx

Return value

static Returns this object to allow chaining methods.

See also

https://htmx.org/attributes/hx-history/

File

core/lib/Drupal/Core/Htmx/Htmx.php, line 1009

Class

Htmx
Presents the HTMX controls for developers to use with render arrays.

Namespace

Drupal\Core\Htmx

Code

public function history() : static {
  $this->createStringAttribute('hx-history', 'false');
  return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.