Skip to content

Commit d019fc4

Browse files
committed
Reword
1 parent 6b75287 commit d019fc4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

controller.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ and provides methods for getting and setting response headers. The header names
447447
normalized. As a result, the name ``Content-Type`` is equivalent to
448448
the name ``content-type`` or ``content_type``.
449449

450-
In Symfony, a controller usually returns a ``Response`` object::
450+
In Symfony, a controller is required to return a ``Response`` object::
451451

452452
use Symfony\Component\HttpFoundation\Response;
453453

@@ -465,11 +465,11 @@ response types. Some of these are mentioned below. To learn more about the
465465

466466
.. note::
467467

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.
473473

474474
Accessing Configuration Values
475475
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)