Recommended Twig File Extension

Is there a recommended file extension for Twig templates? I have seen the following use and would like to match most other developers.

  • myTemplate.html.twig
  • myTemplate.twig
  • myTemplate.html
  • myTemplate.tmpl
+6
source share
1 answer

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

+3
source

Source: https://habr.com/ru/post/975605/


All Articles