You are here

public function TestPageTestController::testPage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/test_page_test/src/Controller/TestPageTestController.php \Drupal\test_page_test\Controller\TestPageTestController::testPage()
  2. 9 core/modules/system/tests/modules/test_page_test/src/Controller/TestPageTestController.php \Drupal\test_page_test\Controller\TestPageTestController::testPage()

Returns a test page and sets the title.

2 string references to 'TestPageTestController::testPage'
menu_test.routing.yml in core/modules/system/tests/modules/menu_test/menu_test.routing.yml
core/modules/system/tests/modules/menu_test/menu_test.routing.yml
test_page_test.routing.yml in core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml
core/modules/system/tests/modules/test_page_test/test_page_test.routing.yml

File

core/modules/system/tests/modules/test_page_test/src/Controller/TestPageTestController.php, line 15

Class

TestPageTestController
Controller routines for test_page_test routes.

Namespace

Drupal\test_page_test\Controller

Code

public function testPage() {
  $link_text = t('Visually identical test links');
  return [
    '#title' => t('Test page'),
    '#markup' => t('Test page text.') . "<a href=\"/user/login\">{$link_text}</a><a href=\"/user/register\">{$link_text}</a>",
    '#attached' => [
      'drupalSettings' => [
        'test-setting' => 'azAZ09();.,\\\\/-_{}',
      ],
    ],
  ];
}