function HtmxRequestInfoTrait::getHtmxTriggerName
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Htmx/HtmxRequestInfoTrait.php \Drupal\Core\Htmx\HtmxRequestInfoTrait::getHtmxTriggerName()
Retrieves the trigger name from an HTMX request header.
Return value
string The value of the 'HX-Trigger-Name' header, or an empty string if not set.
2 calls to HtmxRequestInfoTrait::getHtmxTriggerName()
- ConfigSingleExportForm::buildForm in core/
modules/ config/ src/ Form/ ConfigSingleExportForm.php - Form constructor.
- HtmxRequestInfoTest::testGetHtmxTriggerName in core/
tests/ Drupal/ Tests/ Core/ Htmx/ HtmxRequestInfoTest.php - Tests the getHtmxTriggerName method.
File
-
core/
lib/ Drupal/ Core/ Htmx/ HtmxRequestInfoTrait.php, line 98
Class
- HtmxRequestInfoTrait
- Provides methods for getting information about the HTMX request.
Namespace
Drupal\Core\HtmxCode
protected function getHtmxTriggerName() : string {
return $this->getRequest()->headers
->get('HX-Trigger-Name', '');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.