function Htmx::confirm

Creates a `data-hx-confirm` attribute.

This attribute instructs HTMX to shows a confirm() dialog before issuing a request.

Parameters

string $message: The user facing message.

Return value

static Returns this object to allow chaining methods.

See also

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

File

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

Class

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

Namespace

Drupal\Core\Htmx

Code

public function confirm(string $message) : static {
  $this->createStringAttribute('hx-confirm', $message);
  return $this;
}

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