Skip to content

Commit 37bdf76

Browse files
committed
added a sentence about the HttpException::setHeaders method
1 parent cf2fb97 commit 37bdf76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/http_kernel/introduction.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,9 @@ below for more details).
560560
then ``getStatusCode`` and ``getHeaders`` are called on the exception
561561
and used to populate the headers and status code of the ``FlattenException``
562562
object. The idea is that these are used in the next step when creating
563-
the final response.
563+
the final response. If you want to set custom HTTP headers, you can always
564+
use the ``setHeaders`` method on exceptions derived from the
565+
:class:`Symfony\\Component\\HttpKernel\\Exception\\HttpException` class.
564566

565567
3) A controller is executed and passed the flattened exception. The exact
566568
controller to render is passed as a constructor argument to this listener.
@@ -595,7 +597,7 @@ each event has their own event object:
595597
===================== ================================ ===================================================================================
596598
Name ``KernelEvents`` Constant Argument passed to the listener
597599
===================== ================================ ===================================================================================
598-
kernel.request ``KernelEvents::REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent`
600+
kernel.request ``KernelEvents::REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent`
599601
kernel.controller ``KernelEvents::CONTROLLER`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent`
600602
kernel.view ``KernelEvents::VIEW`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent`
601603
kernel.response ``KernelEvents::RESPONSE`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent`

0 commit comments

Comments
 (0)