PHPackages                             phongdatgl/smartyprovider - 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. phongdatgl/smartyprovider

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

phongdatgl/smartyprovider
=========================

Smarty service provider for silex (not compiled templates\_c, multiple assign variables)

08PHP

Since Dec 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/phongdatgl/Silex_SmartyServiceProvider)[ Packagist](https://packagist.org/packages/phongdatgl/smartyprovider)[ RSS](/packages/phongdatgl-smartyprovider/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

SmartyServiceProvider
=====================

[](#smartyserviceprovider)

*SmartyServiceProvider* sẽ tạo ra provider cho Silex, sử dụng \[Smarty\] () làm template thay thế cho twig

Tham Số
-------

[](#tham-số)

- **smarty.class\_path** (string, optional): Path tới thư mục libs của Smarty.
- **smarty.options** (array, optional): Options một số API của \[Smarty\] (). Xem thêm: \[Smarty documentation\] ()

Dịch Vụ
-------

[](#dịch-vụ)

- **smarty**: Sử dụng `Smarty` template enginer. Có tùy chỉnh phù hợp với Silex Application

Cài đặt
-------

[](#cài-đặt)

Đường dẫn của \[Smarty\] () tại `vendor/Smarty` . Hãy chắc chắn rằng nó tồn tại:

```
use Phongdatgl\Smarty\ServiceProvider as SmartyServiceProvider;

define('APP_PATH', '/path/your/project');
$app->register(new SmartyServiceProvider(), array(
          //'smarty.dir' => APP_PATH . '/vendor/Smarty/', //có hoặc không. Không có thì app sẽ mặc định lấy từ vendor
          'smarty.options' => array(
                'template_dir' => APP_PATH . '/views',
                'caching'         => false,
                'force_compile'   => false,
                'use_sub_dirs'    => false)));
```

Sử dụng
-------

[](#sử-dụng)

Sử dụng trên silex

```
$app->get('/hello/{name}', function ($name) use ($app) {
	$app['smarty']->assign('name', 'John Doe');
    return $app['smarty']->render('hello.tpl', array('age'=>15));
});
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3400817?v=4)[Nguyen Van Dat](/maintainers/phongdatgl)[@phongdatgl](https://github.com/phongdatgl)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/phongdatgl-smartyprovider/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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