- Drupal 8 Module Development
- Daniel Sipos
- 184字
- 2021-07-02 12:22:46
Twig
Theme engines are responsible for doing the actual output via template files. Although previous versions of Drupal were capable of using different theme engines, one stood out and was used 99.9 percent of the time (statistic made up by me on the spot): PHPTemplate. This theme engine used PHP files with the .tpl.php extension and contained both markup and PHP. Seasoned Drupal developers grew accustomed to this practice, but it was always more difficult for frontend developers to use and theme against.
In Drupal 8, it was abandoned in favor of the Twig templating engine created by SensioLabs (the people responsible for the Symfony project). As mentioned, theme functions were also deprecated in favor of outputting everything through a Twig file. This brought about many improvements to the theme system and quite some joy to the frontend community. For example, it has improved security and readability, and has made it much less important to be actually versed in PHP to be able to take part in the theming of a Drupal site.
All Twig template files in Drupal 8 have the .html.twig extension.
- JavaScript前端開發模塊化教程
- Python從小白到大牛
- 少年輕松趣編程:用Scratch創作自己的小游戲
- 認識編程:以Python語言講透編程的本質
- Mastering Ubuntu Server
- Scratch 3游戲與人工智能編程完全自學教程
- The Complete Coding Interview Guide in Java
- Mastering Android Game Development
- Internet of Things with ESP8266
- Red Hat Enterprise Linux Troubleshooting Guide
- OpenCV with Python Blueprints
- 進入IT企業必讀的324個Java面試題
- Python第三方庫開發應用實戰
- Test-Driven iOS Development with Swift
- Pandas 1.x Cookbook