function TestController::simple

Same name in other branches
  1. 9 core/modules/system/tests/modules/conneg_test/src/Controller/TestController.php \Drupal\conneg_test\Controller\TestController::simple()
  2. 8.9.x core/modules/system/tests/modules/conneg_test/src/Controller/TestController.php \Drupal\conneg_test\Controller\TestController::simple()
  3. 10 core/modules/system/tests/modules/content_negotiation_test/src/Controller/TestController.php \Drupal\content_negotiation_test\Controller\TestController::simple()

Returns a json response.

Return value

\Symfony\Component\HttpFoundation\JsonResponse

1 string reference to 'TestController::simple'
content_negotiation_test.routing.yml in core/modules/system/tests/modules/content_negotiation_test/content_negotiation_test.routing.yml
core/modules/system/tests/modules/content_negotiation_test/content_negotiation_test.routing.yml

File

core/modules/system/tests/modules/content_negotiation_test/src/Controller/TestController.php, line 21

Class

TestController
Test controller for content negotiation tests.

Namespace

Drupal\content_negotiation_test\Controller

Code

public function simple() {
    return new JsonResponse([
        'some' => 'data',
    ]);
}

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