function Htmx::retargetHeader

Set HX-Retarget header.

Parameters

string $strategy: CSS selector that replaces the target to a different element on the page.

Return value

static Self for chaining.

See also

https://htmx.org/reference/#response_headers

File

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

Class

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

Namespace

Drupal\Core\Htmx

Code

public function retargetHeader(string $strategy) : static {
  $this->headers
    ->set('HX-Retarget', $strategy);
  return $this;
}

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