function Htmx::morphSkip

Creates a `data-hx-morph-skip` attribute.

The hx-morph-skip attribute leaves an element untouched during a morph swap. htmx copies no attributes and morphs no children.

As this attribute always marks a single element, modifiers are not applicable.

Parameters

bool $toggle: Whether to toggle the attribute on or off. Defaults to TRUE.

Return value

static Returns this object to allow chaining methods.

See also

https://four.htmx.org/reference/attributes/hx-morph-skip/

File

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

Class

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

Namespace

Drupal\Core\Htmx

Code

public function morphSkip(bool $toggle = TRUE) : static {
  $this->createBooleanAttribute('hx-morph-skip', $toggle, self::NO_MODIFIER);
  return $this;
}

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