We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51eb51a commit 91b2d00Copy full SHA for 91b2d00
book/controller.rst
@@ -774,6 +774,20 @@ There are also special classes to make certain kinds of responses easier:
774
:class:`Symfony\\Component\\HttpFoundation\\StreamedResponse`.
775
See :ref:`streaming-response`.
776
777
+JSON helper
778
+~~~~~~~~~~~
779
+
780
+You can simplify sending JSON response with
781
+:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::json`
782
+helper::
783
784
+ public function jsonAction()
785
+ {
786
+ $data = [1, 2, 3];
787
788
+ return $this->json($data);
789
+ }
790
791
.. seealso::
792
793
Now that you know the basics you can continue your research on Symfony
0 commit comments