Skip to content

Commit f1441b2

Browse files
javiereguiluzwouterj
authored andcommitted
Explained how contents are serialized
1 parent 6824706 commit f1441b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

book/controller.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,10 @@ a ``JsonResponse`` and encodes the given contents automatically::
791791
// return $this->json($data, $status = 200, $headers = array(), $context = array());
792792
}
793793

794+
If the :doc:`serializer service </cookbook/serializer>`_ is enabled in your
795+
application, contents passed to ``json()`` are encoded with it. Otherwise,
796+
the :phpfunction:`json_encode()` function is used.
797+
794798
.. seealso::
795799

796800
Now that you know the basics you can continue your research on Symfony

0 commit comments

Comments
 (0)