PHPackages                             t-moennich/gk-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. t-moennich/gk-smarty

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

t-moennich/gk-smarty
====================

Zend Framework 2 Module that provides a Smarty rendering strategy

0.5.5(10y ago)014MITPHPPHP &gt;=5.3.3

Since Mar 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/t-moennich/gk-smarty)[ Packagist](https://packagist.org/packages/t-moennich/gk-smarty)[ Docs](http://www.github.com/t-moennich/GkSmarty/)[ RSS](/packages/t-moennich-gk-smarty/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (7)Used By (0)

GkSmarty - Smarty Module for Zend Framework 2
=============================================

[](#gksmarty---smarty-module-for-zend-framework-2)

GkSmarty is a module for integrating the [Smarty](http://www.smarty.net) template engine with [Zend Framework 2](http://framework.zend.com).

Installation with Composer
--------------------------

[](#installation-with-composer)

Installing via [Composer](http://getcomposer.org) is the only supported method.

1. Add `"t-moennich/gk-smarty": "dev-master"` to your `composer.json` file and run `php composer.phar update`.
2. Add `GkSmarty` to your application's `config/application.config.php` file under the `modules` key.

Configuration
-------------

[](#configuration)

For information on configuring GkSmarty, refer to the [module config file](https://github.com/t-moennich/gk-smarty/tree/master/config/module.config.php).

There is also a [sample configuration file](https://github.com/t-moennich/gk-smarty/tree/master/config/gk-smarty.config.php.dist) with all available configuration options.

You can set options for the Smarty engine under the `smarty_options` configuration key (eg `force_compile`, etc).

Pay attention to the `compile_dir` and `cache_dir` keys. Smarty needs write access to the directories specified there.

Documentation
-------------

[](#documentation)

### Using ZF2 View Helpers

[](#using-zf2-view-helpers)

Using view helpers of ZF2 is supported. Just call the view helper as you would do in a PHTML template:

```
{$this->docType()}

{$this->basePath('some/path')}
```

### View helpers that need access to the renderer

[](#view-helpers-that-need-access-to-the-renderer)

ZF2 has some issues with supporting multiple renderers with view helpers. GkSmarty uses it's own `HelperPluginManager` to work around this issue. The default plugin manager from ZF2 is added as a peering manager to ease using view helpers that do not required access to the renderer. This means

You must register view helpers that require a renderer with GkSmarty's helper manager. Refer to `module.config.php` for an example. Some defaults have been taken care of for you (see [HelperPluginManager](https://github.com/gkralik/gk-smarty/tree/master/src/GkSmarty/View/HelperPluginManager.php) for details).

Acknowledgements
----------------

[](#acknowledgements)

Thanks to [ZfcTwig](https://github.com/ZF-Commons/ZfcTwig) for an excellent example on how to integrate templating engines with ZF2 and for finding a workaround for view helpers that need access to the renderer (see above).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.5% 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 ~103 days

Recently: every ~129 days

Total

6

Last Release

3938d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec721ea62d7e7ce9ad5d6f21181d7cba0fcb259514ef87415b98f0c796676ebb?d=identicon)[t-moennich](/maintainers/t-moennich)

---

Top Contributors

[![gkralik](https://avatars.githubusercontent.com/u/4949303?v=4)](https://github.com/gkralik "gkralik (32 commits)")[![t-moennich](https://avatars.githubusercontent.com/u/6061136?v=4)](https://github.com/t-moennich "t-moennich (3 commits)")[![thestanislav](https://avatars.githubusercontent.com/u/1858311?v=4)](https://github.com/thestanislav "thestanislav (2 commits)")

---

Tags

modulezf2smarty

### Embed Badge

![Health badge](/badges/t-moennich-gk-smarty/health.svg)

```
[![Health](https://phpackages.com/badges/t-moennich-gk-smarty/health.svg)](https://phpackages.com/packages/t-moennich-gk-smarty)
```

###  Alternatives

[zf-commons/zfc-twig

Zend Framework 2 Module that provides a Twig rendering strategy and extensions to render actions or trigger events from your templates

93576.6k7](/packages/zf-commons-zfc-twig)

PHPackages © 2026

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