EnforcedResponseException::__construct

public EnforcedResponseException::__construct(Response $response, $message = "", $code = 0, \Exception $previous = NULL) Constructs a new enforced response exception. Parameters \Symfony\Component\HttpFoundation\Response $response: The response to be enforced. string $message: (optional) The exception message. int $code: (optional) A user defined exception code. \Exception $previous: (optional) The previous exception for nested exceptions File core/lib/Drupal/Core/Form/EnforcedResponseExceptio

EnforcedResponseException::getResponse

public EnforcedResponseException::getResponse() Return the response to be enforced. @returns \Symfony\Component\HttpFoundation\Response $response The response to be enforced. File core/lib/Drupal/Core/Form/EnforcedResponseException.php, line 43 Class EnforcedResponseException Custom exception to break out of the main request and enforce a response. Namespace Drupal\Core\Form Code public function getResponse() { return $this->response; }

EnforcedResponseException::$response

The response to be enforced. Type: \Symfony\Component\HttpFoundation\Response File core/lib/Drupal/Core/Form/EnforcedResponseException.php, line 17 Class EnforcedResponseException Custom exception to break out of the main request and enforce a response. Namespace Drupal\Core\Form Code protected $response;

EnforcedResponseException

Custom exception to break out of the main request and enforce a response. Hierarchy class \Drupal\Core\Form\EnforcedResponseException extends \Exception File core/lib/Drupal/Core/Form/EnforcedResponseException.php, line 10 Namespace Drupal\Core\Form Members Name Modifiers Type Description EnforcedResponseException::$response protected property The response to be enforced. EnforcedResponseException::getResponse public function Return the response to be enforced.

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 $re

EnforcedResponse::getResponse

public EnforcedResponse::getResponse() Returns the wrapped response. Return value \Symfony\Component\HttpFoundation\Response The wrapped response. File core/lib/Drupal/Core/Form/EnforcedResponse.php, line 73 Class EnforcedResponse A wrapper containing a response which is to be enforced upon delivery. Namespace Drupal\Core\Form Code public function getResponse() { return $this->response; }

EnforcedResponse::createFromException

public static EnforcedResponse::createFromException(\Exception $e) Constructs a new enforced response from the given exception. Note that it is necessary to traverse the exception chain when searching for an enforced response. Otherwise it would be impossible to find an exception thrown from within a twig template. Parameters \Exception $e: The exception where the enforced response is to be extracted from. Return value \Drupal\Core\Form\EnforcedResponse|null The enforced response or NULL if t

EnforcedResponse::$response

The wrapped response object. Type: \Symfony\Component\HttpFoundation\Response; File core/lib/Drupal/Core/Form/EnforcedResponse.php, line 28 Class EnforcedResponse A wrapper containing a response which is to be enforced upon delivery. Namespace Drupal\Core\Form Code protected $response;

EnforcedResponse

A wrapper containing a response which is to be enforced upon delivery. The FormBuilder throws an EnforcedResponseException whenever a form desires to explicitly set a response object. Exception handlers capable of setting the response should extract the response object of such an exception using EnforcedResponse::createFromException(). Then wrap it into an EnforcedResponse object and replace the original response with the wrapped response. Hierarchy class \Symfony\Component\HttpFoundation\Respo

EnforcedFormResponseSubscriber::onKernelResponse

public EnforcedFormResponseSubscriber::onKernelResponse(FilterResponseEvent $event) Unwraps an enforced response. File core/lib/Drupal/Core/EventSubscriber/EnforcedFormResponseSubscriber.php, line 30 Class EnforcedFormResponseSubscriber Handle the EnforcedResponseException and deliver an EnforcedResponse. Namespace Drupal\Core\EventSubscriber Code public function onKernelResponse(FilterResponseEvent $event) { $response = $event->getResponse(); if ($response instanceof EnforcedRe