imponeer / smarty-extensions-contracts
Archived: use Smarty 5 built-in extension system for extensions
Package info
github.com/imponeer/smarty-extensions-contracts
pkg:composer/imponeer/smarty-extensions-contracts
Requires
- php: >=7.3
- smarty/smarty: ^4.3 || ^5.0
This package is auto-updated.
Last update: 2026-03-30 14:52:55 UTC
README
Smarty Extensions Contracts
Archived: Smarty 5 includes its own extension system, so this library is no longer maintained. For new projects, rely on the native Smarty 5 approach instead of this package.
Smarty 3 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
This package is archived and kept for existing consumers. New projects should not depend on it because Smarty 5 already provides the needed extension system.
To install and use this package in legacy setups, we recommend to use Composer:
composer require imponeer/smarty-extensions-contracts
Otherwise, you need to include manually files from src/ directory.
Mapping
| Extension type | Interface name | What it for? |
|---|---|---|
| Template Function | \Imponeer\Contracts\Smarty\Extension\SmartyFunctionInterface | Interface that lets to define smarty function extension |
| Modifier | \Imponeer\Contracts\Smarty\Extension\SmartyModifierInterface | Interface that lets to define smarty function extension |
| Block Function | \Imponeer\Contracts\Smarty\Extension\SmartyBlockInterface | Extension interface for smarty block functions |
| Compiler Function | \Imponeer\Contracts\Smarty\Extension\SmartyCompilerInterface | Interface that lets to define smarty compiler extension (that is not internal function based) |
| Prefilter | \Imponeer\Contracts\Smarty\Filter\SmartyPreFilterInterface | Defines filter that is executed to process template source before compilation |
| Postfilter | \Imponeer\Contracts\Smarty\Filter\SmartyPostFilterInterface | Defines filter that is executed to process template source after compilation |
| Output filter | \Imponeer\Contracts\Smarty\Filter\SmartyOutputFilterInterface | Defines filter that is executed before template is loaded and executed but before displayed |
| Resource | \Imponeer\Contracts\Smarty\Extension\SmartyResourceInterface | Defines custom smarty resource type |
How to contribute?
This project is archived, so we don't accept new issues or pull requests. If you need updates, fork the repository and use your fork as the main project.