PHPackages                             lovefc/eztpl - 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. lovefc/eztpl

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

lovefc/eztpl
============

一个小型高效的PHP单文件模板引擎

1.7.0(2y ago)651MITPHPPHP &gt;=5.3.0

Since Oct 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lovefc/eztpl)[ Packagist](https://packagist.org/packages/lovefc/eztpl)[ Docs](https://github.com/lovefc/eztpl.git)[ RSS](/packages/lovefc-eztpl/feed)WikiDiscussions master Synced 1mo ago

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

eztpl - 一个小巧的PHP模板引擎类库
======================

[](#eztpl---一个小巧的php模板引擎类库)

一个小巧的PHP模板引擎类库

简单的语法，自由地定义模板语法，一个核心文件！

如果您注意到一些被疏忽的问题，欢迎把它提交给我！

> 没想到我2023年还在更新吧，哈哈哈，为曾经的青春干杯！

Composer
--------

[](#composer)

```
{
    "require": {
        "lovefc/eztpl": "1.7.0"
    }
}

```

更新记录
----

[](#更新记录)

- 1.3.5 =&gt; 修改了原来的静态缓存方法，更实用，更方便
- 1.3.6 =&gt; 重写了编译算法，更准确，高效。
- 1.3.7 =&gt; 提升了编译速度，改掉原来的内存释放方法，改正了模板变量解析的bug(更新时间:2014/10/04 23:49)
- 1.3.8 =&gt; 修改上一个版本引用文件的bug，改进了变量转换方式，新增加变量销毁方法(更新时间:2014/10/09 08:51)
- 1.3.9 =&gt; 添加了页面gzip压缩，但是效果不太好,目前为止，还没有较好的解决方法，建议在php页面中，首先require lovefc.class php(更新时间:2014/10/13 10:04)
- 1.4.0 =&gt; 解决引用文件编译的bug,更改了引用方式(更新时间:2014/10/18 23:36)
- 1.4.1 =&gt; 添加了新的缓存方式，添加了缓存判断，优化了部分细节。(更新时间:2014/10/22 10:25)
- 1.4.2 =&gt; 修复了一个赋值转换的bug。(更新时间:2014/10/26 0:01)
- 1.4.3 =&gt; 修改了引用模板文件的方式。(更新时间:2014/10/29 11:45)
- 1.4.4 =&gt; 优化编译过程，减少对类方法的引用，添加对编译变量和引用方式的新方法(更新时间:2014/11/16 02:48)
- 1.4.5 =&gt; 彻底更改了原来的目录结构,新版中不在考虑编译文件目录,对模版存放的目录进行了分类,同时改进了缓存目录的尴尬问题,解决了文件名相同的模版文件使用的是一个缓存文件的可能性,使得模版更加灵活,改进了原来的分割符,正式使用{}来分割,改进了里面一些自以为是的变量命名,尽量做到规范化,去掉了原来的页面压缩功能,使代码精简,其实代码并没有精简好多,反而更大了,在最后我会去掉类中所有的注释和空格,尽量减少类的体积,相应的也能提高加载的速度 (2015/1/14 22:51)
- 1.4.6 =&gt; 改进了编译的一个小问题(2015/1/15 14:10)
- 1.4.7 =&gt; 把原来的指定编译文件目录的功能又加上去了,并且优化了不少细节问题,经过简单的测试,尚未发现bug的存在(2015/1/15 19:26)
- 1.4.8 =&gt; 继续优化细节,并且重新添加了gzip压缩功能(2015/1/16 00:24)
- 1.4.9 =&gt; 发现页面引用的一个严重bug,并修复好了他(2015/1/18 03:32)
- 1.5.0 =&gt; 更改了模版的设置方式,采用常量设置,精简了代码,去掉了页面静态化功能,因为太鸡肋,去掉了执行时间,因为不准确(2015/1/25 13:09)
- 1.6.0 =&gt; 修复了变量翻译冲突的bug,去掉了编译变量类型选择,感谢大隐同学的反馈和建议(2015/07/08 10:28)
- 1.6.e =&gt; 废除了常量设置方法，采用了数组定义，这次更新不代表正式版本，只是为了适合新手(2015/09/07 0:39)
- 1.6.1 =&gt; 修复了一个创建目录的bug，因为一些不知名的原因导致强制编译始终处于开启的状态，目前已修复，添加了自定义ubb转换的功能，尚未完善，等待测试(2015/08/08 0:11)
- 1.6.2 =&gt; 使用单例模式，优化了方法访问权限，修改了实时编译功能，并使引用模版里设置的变量可以共用，去掉了gzip压缩功能(2015/10/08 03:52)
- 1.6.3 =&gt; 更改了一个外部变量赋值转换的问题(2015/11/15 03:35)
- 1.6.4 =&gt; 更改了模板引用文件的方法，现在可以引用子目录中的文件了(2015/12/14 13:10)
- 1.6.5 =&gt; 发现一个小bug,已经修复了(2016/07/4 14:21)
- 1.6.6 =&gt; 修改了添加正则的方式,更改了传参方法(2016/10/9 14:50)
- 1.66.e =&gt; 修改了文件创建方法，因为这个方法是很久以前写的(2016/12/21 13:26)
- 1.6.7 =&gt; 重构了代码，去掉了一些功能，让代码更加的规范化(2017/5/11 15:51)
- 1.6.8 =&gt; 更新了模版引擎一处不能正确解析.简写数组的bug(2017/6/7 23:17:30)
- 1.6.9 =&gt; 修改内部编译目录的问题(2021-02-24 23:28:45)
- 1.7.0 =&gt; 优化部分细节问题(2023-10-21 13:45:16)

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

Copyright (c) 2013-[lovefc](http://lovefc.cn)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 67.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

938d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29d97b6587197b373f7244e3d4a84e6944ffd971ff10a88256c39432e3fb8936?d=identicon)[lovefc](/maintainers/lovefc)

---

Top Contributors

[![eztpl](https://avatars.githubusercontent.com/u/28654642?v=4)](https://github.com/eztpl "eztpl (25 commits)")[![lovefc](https://avatars.githubusercontent.com/u/18413965?v=4)](https://github.com/lovefc "lovefc (10 commits)")[![bycodes](https://avatars.githubusercontent.com/u/34326540?v=4)](https://github.com/bycodes "bycodes (2 commits)")

---

Tags

phptemplate

### Embed Badge

![Health badge](/badges/lovefc-eztpl/health.svg)

```
[![Health](https://phpackages.com/badges/lovefc-eztpl/health.svg)](https://phpackages.com/packages/lovefc-eztpl)
```

###  Alternatives

[alhimik1986/php-excel-templator

PHP Spreadsheet extension for generating excel files from template

350336.7k1](/packages/alhimik1986-php-excel-templator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
