function UpdateTestController::updateError

Same name and namespace in other branches
  1. 9 core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php \Drupal\update_test\Controller\UpdateTestController::updateError()
  2. 10 core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php \Drupal\update_test\Controller\UpdateTestController::updateError()
  3. 11.x core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php \Drupal\update_test\Controller\UpdateTestController::updateError()

Displays an Error 503 (Service unavailable) page.

Return value

\Symfony\Component\HttpFoundation\Response Returns the response with a special header.

1 string reference to 'UpdateTestController::updateError'
update_test.routing.yml in core/modules/update/tests/modules/update_test/update_test.routing.yml
core/modules/update/tests/modules/update_test/update_test.routing.yml

File

core/modules/update/tests/modules/update_test/src/Controller/UpdateTestController.php, line 20

Class

UpdateTestController
Provides different routes of the update_test module.

Namespace

Drupal\update_test\Controller

Code

public function updateError() {
    $response = new Response();
    $response->setStatusCode(503);
    $response->headers
        ->set('Status', '503 Service unavailable');
    return $response;
}

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