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:
777777JSON Helper
778778~~~~~~~~~~~
779779
780+ .. versionadded :: 3.1
781+ The ``json() `` helper was introduced in Symfony 3.1.
782+
780783Returning JSON contents is increasingly popular for API-based applications. For
781784that reason, the base controller class defines a ``json() `` method which creates
782785a ``JsonResponse `` and encodes the given contents automatically::
@@ -793,7 +796,7 @@ a ``JsonResponse`` and encodes the given contents automatically::
793796
794797If the :doc: `serializer service </cookbook/serializer >` is enabled in your
795798application, 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
You can’t perform that action at this time.
0 commit comments