public function EnforcedResponse::__construct

public EnforcedResponse::__construct(Response $response)

Constructs an enforced response.

Use EnforcedResponse::createFromException() instead.

Parameters

\Symfony\Component\HttpFoundation\Response $response: The response to wrap.

Overrides Response::__construct

File

core/lib/Drupal/Core/Form/EnforcedResponse.php, line 62

Class

EnforcedResponse
A wrapper containing a response which is to be enforced upon delivery.

Namespace

Drupal\Core\Form

Code

public function __construct(Response $response) {
  parent::__construct('', 500);
  $this->response = $response;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Form!EnforcedResponse.php/function/EnforcedResponse::__construct/8.1.x