官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 和龙市| 武山县| 怀集县| 于都县| 淅川县| 张家港市| 墨江| 乌海市| 周至县| 揭阳市| 扎囊县| 临夏市| 延庆县| 象州县| 社会| 分宜县| 轮台县| 无为县| 平乡县| 新绛县| 连城县| 乐昌市| 东港市| 马公市| 来安县| 新蔡县| 离岛区| 诸暨市| 确山县| 岳普湖县| 桐柏县| 盐池县| 阳东县| 滨州市| 田阳县| 南昌市| 东光县| 天镇县| 湘西| 怀宁县| 浪卡子县|