function Htmx::createStringAttribute

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Htmx/Htmx.php \Drupal\Core\Htmx\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.

int $modifiers: The modifiers to apply to the attribute id.

20 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::disable in core/lib/Drupal/Core/Htmx/Htmx.php
Creates a `data-hx-disable` attribute.
Htmx::encoding in core/lib/Drupal/Core/Htmx/Htmx.php
Creates a `data-hx-encoding` attribute.

... See full list

File

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

Class

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

Namespace

Drupal\Core\Htmx

Code

protected function createStringAttribute(string $id, string $value, int $modifiers) : void {
  $key = $this->keyWithModifiers($id, $modifiers);
  $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.