PHPackages                             emmetltd/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. [Templating &amp; Views](/categories/templating)
4. /
5. emmetltd/think-smarty

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

emmetltd/think-smarty
=====================

ThinkPHP5.1 Smarty Template Driver

1.0.0(7y ago)1286MITPHPPHP &gt;=5.4.0

Since Dec 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/emmtltd/think-smarty)[ Packagist](https://packagist.org/packages/emmetltd/think-smarty)[ Docs](http://www.emmetltd.com)[ RSS](/packages/emmetltd-think-smarty/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

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

[](#think-smarty)

ThinkPHP5.1Smarty 引擎驱动

安装方法
----

[](#安装方法)

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

ThinkPHP5.1 配置template.php文件中参数
-------------------------------

[](#thinkphp51-配置templatephp文件中参数)

```
return [
    // 模板引擎类型 支持 php think 支持扩展
    'type'         => 'Smarty',
    // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
    'auto_rule'    => 1,
    // 模板路径
    'view_path'    => '',
    // 模板后缀
    'view_suffix'  => 'html',
    // 模板文件名分隔符
    'view_depr'    => '_', //DIRECTORY_SEPARATOR,
    // 模板引擎普通标签开始标记
    'tpl_begin'    => '',
    // 标签库标签开始标记
    'taglib_begin' => '{',
    // 标签库标签结束标记
    'taglib_end'   => '}',

	'view_replace_str'  =>  [   //字符替换部分
        '/Upfiles/'=>'http://img.qudian.com/Uploads/',
   ],

];

```

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

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

2693d ago

### Community

Maintainers

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

---

Top Contributors

[![flyyao](https://avatars.githubusercontent.com/u/9303444?v=4)](https://github.com/flyyao "flyyao (4 commits)")

---

Tags

thinkphp5.1think-smarty

### Embed Badge

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

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

###  Alternatives

[modx/revolution

MODX Revolution is a Content Management System

1.4k9.1k12](/packages/modx-revolution)[ytake/laravel-smarty

Smarty template engine for Laravel and Lumen

87401.6k](/packages/ytake-laravel-smarty)[noiselabs/smarty-bundle

This Symfony bundle provides integration for the Smarty3 template engine.

53194.4k1](/packages/noiselabs-smarty-bundle)

PHPackages © 2026

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