function Htmx::applyHeaders

Apply the header values to the render array.

1 call to Htmx::applyHeaders()
Htmx::applyTo in core/lib/Drupal/Core/Htmx/Htmx.php
Exports data from internal storage to a render array.

File

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

Class

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

Namespace

Drupal\Core\Htmx

Code

protected function applyHeaders() : array {
  $drupalHeaders = [];
  foreach ($this->headers as $name => $values) {
    foreach ($values as $value) {
      // Set replace to true.
      $drupalHeaders[] = [
        $name,
        $value,
        TRUE,
      ];
    }
  }
  return $drupalHeaders;
}

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