Skip to content

Commit a5113cf

Browse files
smatyasxabbuh
authored andcommitted
added a sentence about the HttpException::setHeaders method
1 parent dc34388 commit a5113cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/http_kernel/introduction.rst

Lines changed: 4 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy