Skip to content

Commit ba6a922

Browse files
dfridrichwouterj
authored andcommitted
Update docs for JSON helper
1 parent 91b2d00 commit ba6a922

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
@@ -781,6 +781,10 @@ You can simplify sending JSON response with
781781
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::json`
782782
helper::
783783

784+
$this->json($data, $status = 200, $headers = array(), $context = array());
785+
786+
For example if you want to send some simple array you can use it like this::
787+
784788
public function jsonAction()
785789
{
786790
$data = [1, 2, 3];

0 commit comments

Comments
 (0)