function HtmxLocationResponseData::__construct
Data for HX-Location headers.
Parameters
\Drupal\Core\Url $path: The path for the GET request.
string $source: The source element of the request.
string $event: An event that “triggered” the request.
string $handler: A callback that will handle the response HTML.
string $target: The target for the swap.
string $swap: The swap strategy.
array<string, string> $values: A set of values to submit with the request.
array<string, string> $headers: Headers to submit with the request.
string $select: A selector for the content to swap into the target.
See also
https://htmx.org/headers/hx-location/
File
-
core/
lib/ Drupal/ Core/ Htmx/ HtmxLocationResponseData.php, line 42
Class
- HtmxLocationResponseData
- Optional data object for HX-Location.
Namespace
Drupal\Core\HtmxCode
public function __construct(public readonly Url $path, public readonly string $source = '', public readonly string $event = '', public readonly string $handler = '', public readonly string $target = '', public readonly string $swap = '', public readonly array $values = [], public readonly array $headers = [], public readonly string $select = '') {
$this->cacheableMetadata = new CacheableMetadata();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.