PHPackages                             runstp/think-template - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. runstp/think-template

ActiveLibrary[Templating &amp; Views](/categories/templating)

runstp/think-template
=====================

the php template engine

v2.0.1(7y ago)037Apache-2.0PHPPHP &gt;=7.1.0

Since Nov 1Pushed 7y agoCompare

[ Source](https://github.com/RunsTp/think-template)[ Packagist](https://packagist.org/packages/runstp/think-template)[ RSS](/packages/runstp-think-template/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (9)Used By (0)

think-template
==============

[](#think-template)

从ThinkPHP5.1独立出来的编译型模板引擎

主要特性
----

[](#主要特性)

- 支持XML标签库和普通标签的混合定义；
- 支持直接使用PHP代码书写；
- 支持文件包含；
- 支持多级标签嵌套；
- 支持布局模板功能；
- 一次编译多次运行，编译和运行效率非常高；
- 模板文件和布局模板更新，自动更新模板缓存；
- 系统变量无需赋值直接输出；
- 支持多维数组的快速输出；
- 支持模板变量的默认值；
- 支持页面代码去除Html空白；
- 支持变量组合调节器和格式化功能；
- 允许定义模板禁用函数和禁用PHP语法；
- 通过标签库方式扩展；

安装
--

[](#安装)

```
composer require topthink/think-template
```

用法示例
----

[](#用法示例)

在根目录下创建index.php入口文件测试：

```
