title: use 1 template for all json response in symfony2
body: <p>As I known, each controller must have itself template for json response, how can I force all json response use the same template?</p>
  
  <p>In simple terms, my cotronller/router looks like this:</p>
  
  <pre><code>_myname:
      pattern: /xxx/yyy.{_format}
      defaults: { _controller: bundle:class:myname, _format:html }
      requirements:{ _format: html|json }
  
  
  /**
  * @Template()
  */
  public function mynameAction(){
      return array("data"=&gt;array("error"=&gt;1, "msg"=&gt;"msg"))
  }
  </code></pre>
  
  <p>ok, now it works well, when user request /xxx/yyy.html, the controller will render view "myname.html.twig", when user request /xxx/yyy.json, view "myname.json.twig" will show, but, actually every json tempalte are same, how can I let symfony2 know that:</p>
  
  <p>when user request /xxx/yyy.html, render the "myname.html.twig" as normal <br/>
  when user request /xxx/yyy.json, <b>render other template like "default.json.twig" instead of "myname.json.twig"</b>??</p>
  
  <p>Thanks.</p>