Twig

灵活、快速、安全的PHP模板引擎。(The flexible, fast, and secure template engine for PHP. )

Github stars Tracking Chart

Twig——灵活、快速、安全的PHP模板引擎。Twig是PHP的模板语言,根据新的BSD许可证(代码和文档)发布。Twig使用类似于Django和Jinja模板语言的语法,这启发了Twig运行时环境。

快速: Twig编译模板到纯PHP代码并进行了优化。其开销相比常规PHP代码减少到最低。

安全: Twig有一个沙箱模式,可以评估不可信的模板代码。这允许Twig被用作模板语言的应用程序,用户可以修改模板的设计。

灵活: Twig是由一个灵活的词法分析程序和解析器驱动,这允许开发人员定义自己的自定义标签和过滤器,并创建自己的DSL(domain specific languages,领域特定语言)。”

Main metrics

Overview
Name With Ownertwigphp/Twig
Primary LanguagePHP
Program languagePHP (Language Count: 4)
Platform
License:BSD 3-Clause "New" or "Revised" License
所有者活动
Created At2009-10-07 21:23:38
Pushed At2025-06-06 06:01:41
Last Commit At
Release Count262
Last Release Namev3.21.1 (Posted on 2025-05-03 09:22:00)
First Release Namev0.9.0 (Posted on 2010-01-20 13:38:28)
用户参与
Stargazers Count8.3k
Watchers Count212
Fork Count1.3k
Commits Count7.2k
Has Issues Enabled
Issues Count2157
Issue Open Count37
Pull Requests Count1638
Pull Requests Open Count18
Pull Requests Close Count781
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Twig, the flexible, fast, and secure template language for PHP

Twig is a template language for PHP, released under the new BSD license (code
and documentation).

Twig uses a syntax similar to the Django and Jinja template languages which
inspired the Twig runtime environment.

Sponsors

.. raw:: html

<a href="https://blackfire.io/docs/introduction?utm_source=twig&utm_medium=github_readme&utm_campaign=logo">
    <img src="https://static.blackfire.io/assets/intemporals/logo/png/blackfire-io_secondary_horizontal_transparent.png?1" width="255px" alt="Blackfire.io">
</a>

More Information

Read the documentation_ for more information.

.. _documentation: https://twig.symfony.com/documentation