PHPackages                             zoujingli/think-smarty - 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. zoujingli/think-smarty

ActiveLibrary

zoujingli/think-smarty
======================

ThinkPHP5 Smarty Template Driver

v1.0.8(8y ago)41.1k5MITPHPPHP &gt;=5.4.0

Since Oct 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/zoujingli/think-smarty)[ Packagist](https://packagist.org/packages/zoujingli/think-smarty)[ Docs](https://www.ctolog.com)[ RSS](/packages/zoujingli-think-smarty/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)Dependencies (1)Versions (9)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/99e58f91cdf28145a43ad0ee32d21a26a76a122f866e1bf09cd94e422601c206/68747470733a2f2f706f7365722e707567782e6f72672f7a6f756a696e676c692f7468696e6b2d736d617274792f762f737461626c65)](https://packagist.org/packages/zoujingli/think-smarty)[![Total Downloads](https://camo.githubusercontent.com/7178ef70c20f60f7ec80f808cebaf8aeae2e552368b43c5fd2494b54bd75d993/68747470733a2f2f706f7365722e707567782e6f72672f7a6f756a696e676c692f7468696e6b2d736d617274792f646f776e6c6f616473)](https://packagist.org/packages/zoujingli/think-smarty)[![Latest Unstable Version](https://camo.githubusercontent.com/1d2ad3266e03de710326ecfe647fc8a4dace7ad82f6c6aedab2665391056f6c0/68747470733a2f2f706f7365722e707567782e6f72672f7a6f756a696e676c692f7468696e6b2d736d617274792f762f756e737461626c65)](https://packagist.org/packages/zoujingli/think-smarty)[![License](https://camo.githubusercontent.com/1fd24b93459a1fc5e765925c0e7ff2a08cf1805cd6d01db5c10b81740bed9d33/68747470733a2f2f706f7365722e707567782e6f72672f7a6f756a696e676c692f7468696e6b2d736d617274792f6c6963656e7365)](https://packagist.org/packages/zoujingli/think-smarty)

think-smarty
============

[](#think-smarty)

ThinkPHP5.0 Smarty 引擎驱动

目前只支持`ThinkPHP5.0`仔细查看！

安装方法
----

[](#安装方法)

使用composer安装模版引擎方法: `composer require zoujingli/think-smarty`

ThinkPHP5 配置文件中`template`参数
---------------------------

[](#thinkphp5-配置文件中template参数)

```
[
	// 模板引擎类型，指定为'Smarty'
	'type'         => 'Smarty',
	// 模板路径，默认为当前模块下的`view`目录
	'view_path'    => '',
	// 模板后缀
	'view_suffix'  => 'tpl',
	// 模板文件名分隔符
	'view_depr'    => '.',
	// 模板引擎普通标签开始标记
	'tpl_begin'    => '',
	// 标签库标签开始标记
	'taglib_begin' => '{',
	// 标签库标签结束标记
	'taglib_end'   => '}',
],

```

那么在控制器 `index/index::index` 中 `return view();`时会加载模板 `index/view/index.index.tpl`

模板常量定义
------

[](#模板常量定义)

```
[
  '__ROOT__' => 'http://localhost/service/public',
  '__SELF__' => 'http://localhost/service/public/index.php/index/index.html?id=1&name=3',
  '__APP__' => 'http://localhost/service/public/index.php',
  '__LIB__' => 'http://localhost/service/public/static/plugs',
  '__STATIC__' => 'http://localhost/service/public/static',
  '__UPLOAD__' => 'http://localhost/service/public/static/upload',
]

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 95.2% 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

Every ~65 days

Recently: every ~113 days

Total

8

Last Release

3039d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c806d477ba01d9441023f3cc9a7c70e6491a189d0aae80bca2cc444691e31723?d=identicon)[zoujingli](/maintainers/zoujingli)

---

Top Contributors

[![zoujingli](https://avatars.githubusercontent.com/u/4349951?v=4)](https://github.com/zoujingli "zoujingli (20 commits)")[![PierceTsu](https://avatars.githubusercontent.com/u/13709404?v=4)](https://github.com/PierceTsu "PierceTsu (1 commits)")

---

Tags

thinkphp5think-smarty

### Embed Badge

![Health badge](/badges/zoujingli-think-smarty/health.svg)

```
[![Health](https://phpackages.com/badges/zoujingli-think-smarty/health.svg)](https://phpackages.com/packages/zoujingli-think-smarty)
```

PHPackages © 2026

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