PHPackages                             mranchovy/smarty3 - 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. mranchovy/smarty3

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

mranchovy/smarty3
=================

Integration of Smarty v3 with the Kohana PHP Framework

2.0.2(12y ago)253513[4 issues](https://github.com/MrAnchovy/Kohana_Smarty3/issues)[1 PRs](https://github.com/MrAnchovy/Kohana_Smarty3/pulls)Kohana licensePHP

Since Apr 26Pushed 12y ago7 watchersCompare

[ Source](https://github.com/MrAnchovy/Kohana_Smarty3)[ Packagist](https://packagist.org/packages/mranchovy/smarty3)[ Docs](http://github.com/MrAnchovy/Kohana_Smarty3)[ RSS](/packages/mranchovy-smarty3/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

Smarty3 Module for Kohana
-------------------------

[](#smarty3-module-for-kohana)

This is a module for the [Kohana PHP framework](http://kohanaphp.com/) that integrates the [Smarty Template Engine](http://www.smarty.net/).

Documentation and support for this module can be found on [Github](https://github.com/MrAnchovy/Kohana_Smarty3). Note this version is compatible with Kohana 3.3. For Kohana 3.0-3.2 you want the [1.x branch](https://github.com/MrAnchovy/Kohana_Smarty3/tree/1.x-for-Kohana-3.0-3.2).

**Version 2.0.3-dev**

### Quick Start

[](#quick-start)

- Download and unpack the module
- Put the smarty3 module in your modules directory
- Enable the smarty3 module in your bootstrap file
- To use Smarty for a view you need to create a Smarty template `template_name.tpl` in your application's views directory. Then when you do `$view = View::factory('template_name.tpl')` you can use the $view object just as you would with a regular PHP view.
- That's all there is to it! There's only one hitch, you can't use `$view = new View('template_name.tpl')` or change the template of an existing PHP view object to a Smarty template with `$view->set_filename()`.
- If your controller extends the `Controller_Template` class, you can use a Smarty template for your page layout too - just set `public $template = 'layout_template_name.tpl';` in your controller class.

### Upgrading from earlier Version 2 releases

[](#upgrading-from-earlier-version-2-releases)

- Download and unpack the module
- Replace the existing smarty3 module with the new version
- Delete compiled templates (in `APPPATH/cache/smarty_compiled` by default)

### Upgrading from older versions

[](#upgrading-from-older-versions)

Upgrading from older versions should work as above.

### How does this magic work?

[](#how-does-this-magic-work)

The Smarty module creates a `View` class that extends `Kohana_View` to intercept the `View::factory()` method and return an instance of either the unmodified `Kohana_View` for a PHP template or an instance of `Smarty_View` if the view file has the `.tpl` extension. `Smarty_View` implements the methods of `Kohana_View` to act on a Smarty object. If you are converting existing code, or just prefer to use the Smarty object directly, you can access it with `$view->smarty()`, but note that not all of the available methods have been tested and may produce unpredicatable effects.

### More information

[](#more-information)

Documentation and support for this module can be found on [Github](https://github.com/MrAnchovy/Kohana_Smarty3). Support for Smarty and its standard plugins is of course on the [Smarty](http://www.smarty.net) site.

### Copyright

[](#copyright)

- The Smarty module is Copyright © 2009-14 [Mr Anchovy](http://www.mranchovy.com/).
- Kohana is Copyright © 2007-2014 [Kohana Team](http://kohanaframework.org/).
- Smarty is Copyright © 2001-2014 [New Digital Group, Inc.](http://www.smarty.net/).

### Licence

[](#licence)

This distribution of the Smarty3 Module for Kohana is released under the [Kohana License](http://kohanaframework.org/license)

The distribution of Smarty included in this package is released under the GNU Lesser General Public License (LGPL) - see the Smarty documentation for more details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 95.7% 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 ~0 days

Total

2

Last Release

4403d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ba4e899e570479f6a52afacae911782cae3fee192dc5b50cc8c01e04cb1cf42?d=identicon)[MrAnchovy](/maintainers/MrAnchovy)

---

Top Contributors

[![MrAnchovy](https://avatars.githubusercontent.com/u/124461?v=4)](https://github.com/MrAnchovy "MrAnchovy (45 commits)")[![nikulinsasa](https://avatars.githubusercontent.com/u/3771443?v=4)](https://github.com/nikulinsasa "nikulinsasa (1 commits)")[![prakash](https://avatars.githubusercontent.com/u/261459?v=4)](https://github.com/prakash "prakash (1 commits)")

---

Tags

kohanasmarty

### Embed Badge

![Health badge](/badges/mranchovy-smarty3/health.svg)

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

###  Alternatives

[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)[text/template

Simple and secure string-template-engine (Twig-like syntax) with nested if/elseif/else, loops, filters. Simple OOP api: Just one class doing the job (2-lines of code). Fast and secure: No code-generation, no eval'ed() code. Extensible by callbacks. Fully tested. Rich examples included.

38201.1k10](/packages/text-template)

PHPackages © 2026

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