Tag Archives: Remote procedure call

Returning JSON in a Zend Controller’s Action – Part 2

In a reply from my latest post after following the comments, there is a much elegant solution to this use case. Simply by changing the output with a JSON helper. This also changes the content-type of the returned response.

$data = array(...);
$this->_helper->json($data);