function HtmxTestAttachmentsController::selectBody

Same name and namespace in other branches
  1. main core/modules/system/tests/modules/test_htmx/src/Controller/HtmxTestAttachmentsController.php \Drupal\test_htmx\Controller\HtmxTestAttachmentsController::selectBody()

Tests body targeting and swapping.

Return value

mixed[] A render array.

1 string reference to 'HtmxTestAttachmentsController::selectBody'
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 62

Class

HtmxTestAttachmentsController
Returns responses for HTMX Test Attachments routes.

Namespace

Drupal\test_htmx\Controller

Code

public function selectBody() : array {
  return [
    '#title' => $this->t('Boosted body'),
    '#type' => 'link',
    '#url' => Url::fromRoute('test_htmx.attachments.replace'),
    '#attributes' => [
      'class' => [
        'htmx-test-link',
      ],
    ],
  ];
}

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