function Htmx::query

Creates a `data-hx-query` attribute.

This attribute instructs HTMX to issue a QUERY request to the specified URL.

This request method also accepts no parameters, which issues a QUERY request to the current url. If parameters are used, both are required.

Parameters

\Drupal\Core\Url|null $url: The URL for the QUERY request. If NULL, the current page is used without the query parameters.

int $modifiers: The modifiers to apply to the request. Defaults to no modifiers.

Return value

static Returns self so that attribute methods may be chained.

See also

https://four.htmx.org/reference/attributes/hx-query/

https://www.rfc-editor.org/info/rfc10008/

File

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

Class

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

Namespace

Drupal\Core\Htmx

Code

public function query(?Url $url = NULL, int $modifiers = self::NO_MODIFIER) : static {
  return $this->buildRequestAttribute('hx-query', $url, $modifiers);
}

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