PHPackages                             jxy918/swoft-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. jxy918/swoft-smarty

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

jxy918/swoft-smarty
===================

smarty view base on swoft

v2.0.2(6y ago)467MITPHPCI failing

Since Aug 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jxy918/swoft-smarty)[ Packagist](https://packagist.org/packages/jxy918/swoft-smarty)[ RSS](/packages/jxy918-swoft-smarty/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (4)Used By (0)

swoft-smarty
============

[](#swoft-smarty)

[![Latest Stable Version](https://camo.githubusercontent.com/3b5ac64925a75528b47ec1d1a005e8bb5017361e641102aec42e7f9cb7a1e00d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a78793931382f73776f66742d736d617274792e737667)](https://packagist.org/packages/jxy918/swoft-smarty)[![Php Version](https://camo.githubusercontent.com/c197ef1e57a32c886b2a54d02ead7dbc035f18b3f39a642703b9372eef7819f9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e312d627269676874677265656e2e7376673f6d61784167653d32353932303030)](https://secure.php.net/)[![Swoft Doc](https://camo.githubusercontent.com/ea1431167b522b88916c717b0bfe6348328a8662a684bb128f0b0bd6d22a20d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d70617373696e672d677265656e2e7376673f6d61784167653d32353932303030)](https://www.swoft.org/docs)[![Swoft License](https://camo.githubusercontent.com/1c419f89412ea6c234c184ad6d85decb127c18584858d3707ae7d8e2131eccc4/68747470733a2f2f696d672e736869656c64732e696f2f686578706d2f6c2f706c75672e7376673f6d61784167653d32353932303030)](https://github.com/swoft-cloud/swoft/blob/master/LICENSE)

sowft框架smarty模板组件

smarty template component for swoft.

Swoft-smarty Component

Install, 安装
-----------

[](#install-安装)

- composer install command

```
composer require jxy918/swoft-smarty

```

- smarty default config
- swoft框架里 smarty 的默认配置如下, 默认不需要添加, 如果想要修改, 可以把下面配置放入到bean.php里面, 进行相应的修改即可

```
'smarty' => [
    'debugging'=>true,
    'caching'=>true,
    'cacheLifetime'=>120,
    'leftDelimiter' => '',
    'templateDir' => '@base/resource/template',
    'compileDir' => '@base/runtime/template_c',
    'cacheDir' => '@base/runtime/cache'
]

```

Use in Controller, 控制器里使用如下
---------------------------

[](#use-in-controller-控制器里使用如下)

- app/Http/Controlle/SmartyController.php
- resource/template/smarty.html

app/Http/Controlle/SmartyController.php

```
