From 37bdf761349d25a3776f01e32eb5c84edc1dbc41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Somfai?= Date: Fri, 25 Dec 2015 17:21:28 +0100 Subject: [PATCH] added a sentence about the HttpException::setHeaders method --- components/http_kernel/introduction.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/http_kernel/introduction.rst b/components/http_kernel/introduction.rst index fd4682a9a53..2e2ae670da0 100644 --- a/components/http_kernel/introduction.rst +++ b/components/http_kernel/introduction.rst @@ -560,7 +560,9 @@ below for more details). then ``getStatusCode`` and ``getHeaders`` are called on the exception and used to populate the headers and status code of the ``FlattenException`` object. The idea is that these are used in the next step when creating - the final response. + the final response. If you want to set custom HTTP headers, you can always + use the ``setHeaders`` method on exceptions derived from the + :class:`Symfony\\Component\\HttpKernel\\Exception\\HttpException` class. 3) A controller is executed and passed the flattened exception. The exact controller to render is passed as a constructor argument to this listener. @@ -595,7 +597,7 @@ each event has their own event object: ===================== ================================ =================================================================================== Name ``KernelEvents`` Constant Argument passed to the listener ===================== ================================ =================================================================================== -kernel.request ``KernelEvents::REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent` +kernel.request ``KernelEvents::REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent` kernel.controller ``KernelEvents::CONTROLLER`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent` kernel.view ``KernelEvents::VIEW`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent` kernel.response ``KernelEvents::RESPONSE`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent`