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

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.

Since 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 have the .html.twig extension.

主站蜘蛛池模板: 望城县| 凤阳县| 嫩江县| 华容县| 淮安市| 金沙县| 通榆县| 德昌县| 凉城县| 信阳市| 仪陇县| 徐水县| 遂昌县| 莒南县| 志丹县| 兰坪| 青浦区| 祁东县| 保康县| 峡江县| 昌乐县| 延寿县| 和平县| 甘泉县| 达日县| 扎赉特旗| 新宁县| 蓬莱市| 广元市| 盐源县| 内江市| 罗甸县| 马关县| 简阳市| 吴忠市| 柳林县| 兴业县| 桂东县| 合阳县| 澄江县| 黄梅县|