function Htmx::delete
Creates a `data-hx-delete` attribute.
This attribute instructs HTMX to issue a DELETE request to the specified URL.
This request method also accepts no parameters, which issues a delete request to the current url. If parameters are used, both are required.
Parameters
\Drupal\Core\Url|null $url: The URL for the DELETE request. If NULL the current page is used.
Return value
static returns self so that attribute methods may be chained.
See also
https://htmx.org/attributes/hx-delete/
File
-
core/
lib/ Drupal/ Core/ Htmx/ Htmx.php, line 609
Class
- Htmx
- Presents the HTMX controls for developers to use with render arrays.
Namespace
Drupal\Core\HtmxCode
public function delete(?Url $url = NULL) : static {
return $this->buildRequestAttribute('hx-delete', $url);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.