File tree 1 file changed +6
-6
lines changed 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ and provides methods for getting and setting response headers. The header names
447
447
normalized. As a result, the name ``Content-Type `` is equivalent to
448
448
the name ``content-type `` or ``content_type ``.
449
449
450
- In Symfony, a controller usually returns a ``Response `` object::
450
+ In Symfony, a controller is required to return a ``Response `` object::
451
451
452
452
use Symfony\Component\HttpFoundation\Response;
453
453
@@ -465,11 +465,11 @@ response types. Some of these are mentioned below. To learn more about the
465
465
466
466
.. note ::
467
467
468
- When a controller returns a non-`` Response `` object, a ``kernel.view ``
469
- listener is expected to transform it into a `` Response `` object;
470
- otherwise an exception is thrown.
471
-
472
- See :ref: ` kernel.view event < component-http-kernel-kernel-view >` for details on the `` kernel.view `` event .
468
+ Technically, a controller can return a value other than a ``Response ``.
469
+ However, your application is responsible for transforming that value into a
470
+ `` Response `` object. This is handled using :doc: ` events < /event_dispatcher >`
471
+ (specifically the :ref: ` kernel.view event < component-http-kernel-kernel-view >`),
472
+ an advanced feature you'll learn about later .
473
473
474
474
Accessing Configuration Values
475
475
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments