function SystemTestController::respondWithResponse

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::respondWithResponse()
  2. 10 core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::respondWithResponse()
  3. 9 core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::respondWithResponse()
  4. 8.9.x core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php \Drupal\system_test\Controller\SystemTestController::respondWithResponse()

A simple page callback that uses a plain Symfony response object.

Attributes

#[Route(path: '/system-test/respond-response', name: 'system_test.respond_response', requirements: [ '_access' => 'TRUE', ])]

File

core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php, line 407

Class

SystemTestController
Controller routines for system_test routes.

Namespace

Drupal\system_test\Controller

Code

public function respondWithResponse(Request $request) {
  return new Response('test');
}

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