function Htmx::boost
Creates a `data-hx-boost` attribute.
This attribute instructs HTMX to add progressive enhancement to links or forms. The attribute allows you to “boost” normal anchors and form tags to use AJAX instead. This has the nice fallback that, if the user does not have javascript enabled, the site will continue to work.
Parameters
bool $value: Should the element and its descendants be "boosted"?
Return value
static Returns this object to allow chaining methods.
See also
https://htmx.org/attributes/hx-boost/
File
-
core/
lib/ Drupal/ Core/ Htmx/ Htmx.php, line 858
Class
- Htmx
- Presents the HTMX controls for developers to use with render arrays.
Namespace
Drupal\Core\HtmxCode
public function boost(bool $value) : static {
$this->createStringAttribute('hx-boost', $value ? 'true' : 'false');
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.