Usually you define the format before the .twig extension. Therefore, when you work with Symfony2, you can determine the output format.
myTemplate.json.twig e.g. Therefore, usually you should use this format. But you do not need it.
Here is the problem, but you can see how it works.
https://github.com/symfony/symfony/issues/2920
Stony source share