EnforcedResponse
class EnforcedResponse extends Response (View source)
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.
Properties
| protected Response | $response | The wrapped response object. |
Methods
Constructs an enforced response.
Returns the wrapped response.
Details
static EnforcedResponse|null
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.
__construct(Response $response)
Constructs an enforced response.
Use EnforcedResponse::createFromException() instead.
Response
getResponse()
Returns the wrapped response.