简体   繁体   中英

Recommended Twig file extension

Is there a recommended file extension for Twig templates? I've seen the following used, and would like to be consistent with the majority of other developers.

  • myTemplate.html.twig
  • myTemplate.twig
  • myTemplate.html
  • myTemplate.tmpl

Normally you define the format before the .twig extension. So when you work with Symfony2 for example you can define the output format.

myTemplate.json.twig for example. So normally you should use that format. But you don't need that.

Here is an issue but you can see how it works

https://github.com/symfony/symfony/issues/2920

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM