function Htmx::prompt

Creates a `data-hx-prompt` attribute.

This attribute instructs HTMX to show a prompt() before submitting a request.

Parameters

string $message: The message to display in the prompt.

Return value

static Returns this object to allow chaining methods.

See also

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

File

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

Class

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

Namespace

Drupal\Core\Htmx

Code

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

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