function Htmx::createStringAttribute
Utility method to create and store a string value as an attribute.
Parameters
string $id: The HTMX attribute id.
string $value: The attribute value.
24 calls to Htmx::createStringAttribute()
- Htmx::boost in core/
lib/ Drupal/ Core/ Htmx/ Htmx.php - Creates a `data-hx-boost` attribute.
- Htmx::buildRequestAttribute in core/
lib/ Drupal/ Core/ Htmx/ Htmx.php - Utility function for the request attributes.
- Htmx::confirm in core/
lib/ Drupal/ Core/ Htmx/ Htmx.php - Creates a `data-hx-confirm` attribute.
- Htmx::disabledElt in core/
lib/ Drupal/ Core/ Htmx/ Htmx.php - Creates a `data-hx-disabled-elt` attribute.
- Htmx::disinherit in core/
lib/ Drupal/ Core/ Htmx/ Htmx.php - Creates a `data-hx-disinherit` attribute.
File
-
core/
lib/ Drupal/ Core/ Htmx/ Htmx.php, line 156
Class
- Htmx
- Presents the HTMX controls for developers to use with render arrays.
Namespace
Drupal\Core\HtmxCode
protected function createStringAttribute(string $id, string $value) : void {
$key = self::ATTRIBUTE_PREFIX . $id;
$this->attributes[$key] = new AttributeString($key, $value);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.