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

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

ajiho/think-smarty
==================

Smarty integration for thinkphp6

v2.0.3(1y ago)1114MITPHP

Since Aug 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ajiho/think-smarty)[ Packagist](https://packagist.org/packages/ajiho/think-smarty)[ Docs](https://gitee.com/ajiho/think-smarty)[ RSS](/packages/ajiho-think-smarty/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (8)Used By (0)

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

[](#think-smarty)

基于thinkphp6封装的smarty模板引擎

- [smarty官网文档](https://www.smarty.net/docs/zh_CN/)
- [smarty-github文档](https://smarty-php.github.io/smarty/)
- [smarty-github仓库](https://github.com/smarty-php/smarty)

为什么要封装think-smarty
------------------

[](#为什么要封装think-smarty)

虽然现在流行前后端分离，但是有时难免要用一下mvc这种开发方式做一些小项目,但是think php的模板引擎([ThinkTemplate](https://www.kancloud.cn/manual/think-template/1286403)) 在`phpstorm`中格式化html代码时会各种代码错乱和报错,开发起来特别闹心

### ThinkTemplate

[](#thinktemplate)

[![图片备注](https://raw.githubusercontent.com/ajiho/think-smarty/master/assets/img/think-template.gif)](https://raw.githubusercontent.com/ajiho/think-smarty/master/assets/img/think-template.gif)

### think-smarty

[](#think-smarty-1)

[![图片备注](https://raw.githubusercontent.com/ajiho/think-smarty/master/assets/img/think-smarty.gif)](https://raw.githubusercontent.com/ajiho/think-smarty/master/assets/img/think-smarty.gif)

think-smarty的优点
---------------

[](#think-smarty的优点)

- smarty是一款历史较长、经过多年发展和优化的模板引擎
- smarty是目前市面上知名的三大php模板引擎之一(Smarty、Twig、Blade)
- smarty由于长期稳定的使用和开发，Smarty可以提供较高的稳定性和可靠性
- **phpstorm官方内置支持smarty语法高亮，格式化，折叠**
- think-smarty会自动根据smarty官方的更新而下载最新的稳定版
- think-smarty简化手动集成的繁琐步骤、配置，开箱即用
- thinkphp框架从6.x开始官方默认就不集成模板引擎,意味着你可以安装自己喜欢的模板引擎(think-smarty是个不错的选择)

安装
==

[](#安装)

```
composer require ajiho/think-smarty

```

配置文件
====

[](#配置文件)

安装完毕后会自动生成`/config/smarty.php`

```
