function HtmxTestAttachmentsController::swap
Builds the response with a given swap.
Return value
mixed[] A render array.
1 string reference to 'HtmxTestAttachmentsController::swap'
- test_htmx.routing.yml in core/
modules/ system/ tests/ modules/ test_htmx/ test_htmx.routing.yml - core/modules/system/tests/modules/test_htmx/test_htmx.routing.yml
File
-
core/
modules/ system/ tests/ modules/ test_htmx/ src/ Controller/ HtmxTestAttachmentsController.php, line 32
Class
- HtmxTestAttachmentsController
- Returns responses for HTMX Test Attachments routes.
Namespace
Drupal\test_htmx\ControllerCode
public function swap(string $swap) : array {
$swap = match ($swap) { 'inner-html' => 'innerHTML',
'outer-html' => 'outerHTML',
'text-content' => 'textContent',
'inner-morph' => 'innerMorph',
'outer-morph' => 'outerMorph',
'outer-sync' => 'outerSync',
default => $swap,
};
return self::generateHtmxButton(swap: $swap);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.