File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -777,6 +777,9 @@ There are also special classes to make certain kinds of responses easier:
777
777
JSON Helper
778
778
~~~~~~~~~~~
779
779
780
+ .. versionadded :: 3.1
781
+ The ``json() `` helper was introduced in Symfony 3.1.
782
+
780
783
Returning JSON contents is increasingly popular for API-based applications. For
781
784
that reason, the base controller class defines a ``json() `` method which creates
782
785
a ``JsonResponse `` and encodes the given contents automatically::
@@ -793,7 +796,7 @@ a ``JsonResponse`` and encodes the given contents automatically::
793
796
794
797
If the :doc: `serializer service </cookbook/serializer >` is enabled in your
795
798
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.
797
800
798
801
.. seealso ::
799
802
You can’t perform that action at this time.
0 commit comments