function HtmxRequestInfoTrait::getHtmxPrompt

Retrieves the prompt from an HTMX request header.

Return value

string The value of the 'HX-Prompt' header, or an empty string if not set.

Deprecated

in drupal:11.5.0 and is removed from drupal:12.0.0. There is no replacement.

See also

https://www.drupal.org/node/3583674

1 call to HtmxRequestInfoTrait::getHtmxPrompt()
HtmxRequestInfoTest::testGetHtmxPrompt in core/tests/Drupal/Tests/Core/Htmx/HtmxRequestInfoTest.php
Tests the getHtmxPrompt method.

File

core/lib/Drupal/Core/Htmx/HtmxRequestInfoTrait.php, line 72

Class

HtmxRequestInfoTrait
Provides methods for getting information about the HTMX request.

Namespace

Drupal\Core\Htmx

Code

protected function getHtmxPrompt() : string {
  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:12.0.0. There is no replacement. See https://www.drupal.org/node/3583674', E_USER_DEPRECATED);
  return $this->getRequest()->headers
    ->get('HX-Prompt', '');
}

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