Return JSON ke Ajax di symfony 1.4

Di Action :

....

$data = array() ; //data

$this->getResponse()->setContentType('application/json');

return $this->renderText(json_encode($data));

...