You are here

public function DefaultFormatTestController::content in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/default_format_test/src/DefaultFormatTestController.php \Drupal\default_format_test\DefaultFormatTestController::content()
1 string reference to 'DefaultFormatTestController::content'
default_format_test.routing.yml in core/modules/system/tests/modules/default_format_test/default_format_test.routing.yml
core/modules/system/tests/modules/default_format_test/default_format_test.routing.yml

File

core/modules/system/tests/modules/default_format_test/src/DefaultFormatTestController.php, line 10

Class

DefaultFormatTestController

Namespace

Drupal\default_format_test

Code

public function content(Request $request) {
  $format = $request
    ->getRequestFormat();
  return new CacheableResponse('format:' . $format, 200, [
    'Content-Type' => $request
      ->getMimeType($format),
  ]);
}