function HtmxRequestInfoTrait::getHtmxTrigger
Retrieves the trigger identifier from an HTMX request header.
Return value
string The value of the 'HX-Trigger' header, or an empty string if not set.
1 call to HtmxRequestInfoTrait::getHtmxTrigger()
- HtmxRequestInfoTest::testGetHtmxTrigger in core/
tests/ Drupal/ Tests/ Core/ Htmx/ HtmxRequestInfoTest.php - Tests the getHtmxTrigger method.
File
-
core/
lib/ Drupal/ Core/ Htmx/ HtmxRequestInfoTrait.php, line 88
Class
- HtmxRequestInfoTrait
- Provides methods for getting information about the HTMX request.
Namespace
Drupal\Core\HtmxCode
protected function getHtmxTrigger() : string {
return $this->getRequest()->headers
->get('HX-Trigger', '');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.