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

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.

主站蜘蛛池模板: 汤阴县| 彰武县| 龙南县| 梁河县| 景东| 楚雄市| 广南县| 屏边| 青田县| 肇东市| 晴隆县| 托里县| 陇西县| 汝城县| 香港| 黑河市| 贵定县| 荣成市| 澄迈县| 赤城县| 张家口市| 桂平市| 克什克腾旗| 襄汾县| 永嘉县| 庐江县| 于都县| 沭阳县| 裕民县| 龙山县| 焉耆| 靖江市| 进贤县| 清远市| 沂水县| 礼泉县| 苍南县| 安乡县| 龙陵县| 台南市| 泸定县|