Skip to content

Commit

Permalink
Update docs for JSON helper
Browse files Browse the repository at this point in the history
  • Loading branch information
dfridrich authored and wouterj committed May 21, 2016
1 parent 91b2d00 commit ba6a922
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,10 @@ You can simplify sending JSON response with
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::json`
helper::

$this->json($data, $status = 200, $headers = array(), $context = array());

For example if you want to send some simple array you can use it like this::

public function jsonAction()
{
$data = [1, 2, 3];
Expand Down

0 comments on commit ba6a922

Please sign in to comment.