PHPackages                             imponeer/smarty-extensions-contracts - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. imponeer/smarty-extensions-contracts

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

imponeer/smarty-extensions-contracts
====================================

Interfaces for defining smarty template engine extensions in object way

v3.0.2(2y ago)024.9k↑75%[1 issues](https://github.com/imponeer/smarty-extensions-contracts/issues)2MITPHPPHP &gt;=7.3CI passing

Since Jan 31Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/imponeer/smarty-extensions-contracts)[ Packagist](https://packagist.org/packages/imponeer/smarty-extensions-contracts)[ RSS](/packages/imponeer-smarty-extensions-contracts/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (12)Used By (2)

[![License](https://camo.githubusercontent.com/53523152807a6ca68f63c25c7df7165bf0db589c8d1f6f37568a8d942fa59c2e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f696d706f6e6565722f736d617274792d657874656e73696f6e732d636f6e7472616374732e737667)](LICENSE)[![GitHub release](https://camo.githubusercontent.com/68960fad78ff522899a798c0f9494144e4c7301602b7235dc11f8fefb4398f76/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696d706f6e6565722f736d617274792d657874656e73696f6e732d636f6e7472616374732e737667)](https://github.com/imponeer/smarty-extensions-contracts/releases) [![Maintainability](https://camo.githubusercontent.com/c84dc339010c72325d537beaa7f7f1608aaf3cf0bcf7ed4f44ca1f440af25178/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f37396638396532666532316330303736633239612f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/imponeer/smarty-extensions-contracts/maintainability) [![PHP](https://camo.githubusercontent.com/c50bbd5b06ea1b3f596c80d7042a2c972f966bb0e4e8dc8d5017e3974a65e102/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f696d706f6e6565722f736d617274792d657874656e73696f6e732d636f6e7472616374732e737667)](http://php.net)[![Packagist](https://camo.githubusercontent.com/55ecd3e7e1b34e778928468746f9a087bca177fd8d7e5d9c632f48724c9f416c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f696d706f6e6565722f736d617274792d657874656e73696f6e732d636f6e7472616374732e737667)](https://packagist.org/packages/imponeer/smarty-extensions-contracts)

Smarty Extensions Contracts
===========================

[](#smarty-extensions-contracts)

[Smarty 3](https://github.com/smarty-php/smarty) still doesn't use classes for define most of the possible extensions types. This library tries to fix that - it provides all needed interfaces to define extensions in object way.

Defining smarty extensions in object way also can be useful when working with containers. Smarty extensions that could be registered with tags and then loaded when needed.

Installation
------------

[](#installation)

To install and use this package, we recommend to use [Composer](https://getcomposer.org):

```
composer require imponeer/smarty-extensions-contracts
```

Otherwise, you need to include manually files from `src/` directory.

Mapping
-------

[](#mapping)

Extension typeInterface nameWhat it for?[Template Function](https://www.smarty.net/docs/en/plugins.functions.tpl)[\\Imponeer\\Contracts\\Smarty\\Extension\\SmartyFunctionInterface](src/Extension/SmartyFunctionInterface.php)Interface that lets to define smarty function extension[Modifier](https://www.smarty.net/docs/en/plugins.modifiers.tpl)[\\Imponeer\\Contracts\\Smarty\\Extension\\SmartyModifierInterface](src/Extension/SmartyModifierInterface.php)Interface that lets to define smarty function extension[Block Function](https://www.smarty.net/docs/en/plugins.block.functions.tpl)[\\Imponeer\\Contracts\\Smarty\\Extension\\SmartyBlockInterface](src/Extension/SmartyBlockInterface.php)Extension interface for smarty block functions[Compiler Function](https://www.smarty.net/docs/en/plugins.compiler.functions.tpl)[\\Imponeer\\Contracts\\Smarty\\Extension\\SmartyCompilerInterface](src/Extension/SmartyCompilerInterface.php)Interface that lets to define smarty compiler extension (that is not internal function based)[Prefilter](https://www.smarty.net/docs/en/plugins.prefilters.postfilters.tpl)[\\Imponeer\\Contracts\\Smarty\\Filter\\SmartyPreFilterInterface](src/Filter/SmartyPreFilterInterface.php)Defines filter that is executed to process template source before compilation[Postfilter](https://www.smarty.net/docs/en/plugins.prefilters.postfilters.tpl)[\\Imponeer\\Contracts\\Smarty\\Filter\\SmartyPostFilterInterface](src/Filter/SmartyPostFilterInterface.php)Defines filter that is executed to process template source after compilation[Output filter](https://www.smarty.net/docs/en/plugins.outputfilters.tpl)[\\Imponeer\\Contracts\\Smarty\\Filter\\SmartyOutputFilterInterface](src/Filter/SmartyOutputFilterInterface.php)Defines filter that is executed before template is loaded and executed but before displayed[Resource](https://www.smarty.net/docs/en/plugins.resources.tpl)[\\Imponeer\\Contracts\\Smarty\\Extension\\SmartyResourceInterface](src/Extension/SmartyResourceInterface.php)Defines custom smarty resource typeHow to contribute?
------------------

[](#how-to-contribute)

If you want to add some functionality or fix bugs, you can fork, change and create pull request. If you not sure how this works, try [interactive GitHub tutorial](https://skills.github.com).

If you found any bug or have some questions, use [issues tab](https://github.com/imponeer/smarty-extensions-contracts/issues) and write there your questions.

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance57

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.1% 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 ~107 days

Recently: every ~90 days

Total

10

Last Release

951d ago

Major Versions

v1.0.0 → v2.02021-12-01

v2.0.5 → v3.0.02023-01-03

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v2.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/dba53e399a507d1f60626164c8b1e340a5cc0dc4f0637f4c6aaff8fc239fdaee?d=identicon)[fiammybe](/maintainers/fiammybe)

![](https://www.gravatar.com/avatar/7255f306e0ca27292c50cdd9644c1c04e0d7b0f54bf35e0cdd79dc55c83b4923?d=identicon)[MekDrop](/maintainers/MekDrop)

![](https://www.gravatar.com/avatar/79009323fafcd4974bb1713b12eea0a610f01c4fb21cc5e85d446c4cb66453d4?d=identicon)[skenow](/maintainers/skenow)

---

Top Contributors

[![MekDrop](https://avatars.githubusercontent.com/u/342641?v=4)](https://github.com/MekDrop "MekDrop (36 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (23 commits)")[![fiammybe](https://avatars.githubusercontent.com/u/3736946?v=4)](https://github.com/fiammybe "fiammybe (2 commits)")[![mend-bolt-for-github[bot]](https://avatars.githubusercontent.com/in/16809?v=4)](https://github.com/mend-bolt-for-github[bot] "mend-bolt-for-github[bot] (1 commits)")

---

Tags

contractsextensionshacktoberfestphp-librarysmartysmarty-template-engineinterfacescontractsabstractionsdecouplingextensionssmarty

### Embed Badge

![Health badge](/badges/imponeer-smarty-extensions-contracts/health.svg)

```
[![Health](https://phpackages.com/badges/imponeer-smarty-extensions-contracts/health.svg)](https://phpackages.com/packages/imponeer-smarty-extensions-contracts)
```

###  Alternatives

[symfony/translation-contracts

Generic abstractions related to translation

2.6k698.7M431](/packages/symfony-translation-contracts)[symfony/contracts

A set of abstractions extracted out of the Symfony components

3.9k64.6M103](/packages/symfony-contracts)

PHPackages © 2026

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