Skip to content

Commit 73f71a0

Browse files
committed
[#6502] Syntax issue and added versionadded
1 parent 4237254 commit 73f71a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

book/controller.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,9 @@ There are also special classes to make certain kinds of responses easier:
777777
JSON Helper
778778
~~~~~~~~~~~
779779

780+
.. versionadded:: 3.1
781+
The ``json()`` helper was introduced in Symfony 3.1.
782+
780783
Returning JSON contents is increasingly popular for API-based applications. For
781784
that reason, the base controller class defines a ``json()`` method which creates
782785
a ``JsonResponse`` and encodes the given contents automatically::
@@ -793,7 +796,7 @@ a ``JsonResponse`` and encodes the given contents automatically::
793796

794797
If the :doc:`serializer service </cookbook/serializer>` is enabled in your
795798
application, contents passed to ``json()`` are encoded with it. Otherwise,
796-
the :phpfunction:`json_encode()` function is used.
799+
the :phpfunction:`json_encode` function is used.
797800

798801
.. seealso::
799802

0 commit comments

Comments
 (0)