symfony/symfony — Issue #2920: Blank response on template.json.twig
Author: rokemaster
Created: 2011-12-19 16:09:50+00:00
State: open

Always i get a blank, i have a action in my controller like this

/**
* @Route("/check/{key}.json", defaults={"_format"="json"})
* @Template()
*/
public function processAction($key)
{
/* make thing */
return array('data' => $process_data);
}

in my process.json.twig file i have

{% set res = { 'data': data } %}
{{ res | json_enconde | raw }}

other try

{{ { 'data': data } | json_enconde | raw }}

i've try this too:

{{ 'hello' | json_encode | raw }}

in chrome i get this response:

Connection:close
Content-Length:0
Content-Type:application/json
Date:Mon, 19 Dec 2011 05:13:17 GMT
Server:Apache/2.2.20 (Ubuntu)
X-Powered-By:PHP/5.3.6-13ubuntu3.3

this is a bug?