Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42b4c95

Browse files
committed
update controller return value doc
1 parent29c83bd commit42b4c95

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎controller.rst‎

Lines changed: 9 additions & 1 deletion
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 controlleris required to return a ``Response`` object::
450+
In Symfony, a controllerusually returns a ``Response`` object::
451451

452452
use Symfony\Component\HttpFoundation\Response;
453453

@@ -463,6 +463,14 @@ response types. Some of these are mentioned below. To learn more about the
463463
``Request`` and ``Response`` (and different ``Response`` classes), see the
464464
:ref:`HttpFoundation component documentation<component-http-foundation-request>`.
465465

466+
..note::
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.
473+
466474
Accessing Configuration Values
467475
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
468476

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp