PHPackages                             thelia/smarty-filter-module - 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. thelia/smarty-filter-module

ActiveThelia-module[Templating &amp; Views](/categories/templating)

thelia/smarty-filter-module
===========================

v1.3(10y ago)02081[1 issues](https://github.com/thelia-modules/SmartyFilter/issues)1LGPL-3.0+PHP

Since May 13Pushed 10y ago7 watchersCompare

[ Source](https://github.com/thelia-modules/SmartyFilter)[ Packagist](https://packagist.org/packages/thelia/smarty-filter-module)[ RSS](/packages/thelia-smarty-filter-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (1)

Smarty Filter
=============

[](#smarty-filter)

Allows you to add some filters in smarty render. See the documentation about what is a Smarty filter : [prefilter/postfilter](http://www.smarty.net/docs/en/plugins.prefilters.postfilters.tpl) or [outputfilter](http://www.smarty.net/docs/en/plugins.outputfilters.tpl)

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

[](#installation)

### Manually

[](#manually)

- Copy the module into `/local/modules/` directory and be sure that the name of the module is SmartyFilter.
- Activate it in your thelia administration panel

### Composer

[](#composer)

Add it in your main thelia composer.json file

```
composer require thelia/smarty-filter-module:~1.0

```

Usage
-----

[](#usage)

### Activate Filter

[](#activate-filter)

In Tools menu click on SmartyFilter. You just have to activate the filters you want.

Don't forget to clean your cache after you activate or deactivate filters.

Add your own Filter
-------------------

[](#add-your-own-filter)

You can add your filter in others module and use this module to integrate it. There are 3 steps to check.

### Service

[](#service)

First create a class with a public method named filter. Add your filter in it.

Exemple :

```
class EmailFilter
{

    public function filter($tpl_output, $smarty)
    {
        $tpl_output =
            preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!',
                '$1%40$2', $tpl_output);

        return $tpl_output;
    }
}

```

### Configuration Service

[](#configuration-service)

Declare your service in the config.xml with one of the follow tags :

- thelia.parser.register\_pre\_filter
- thelia.parser.register\_post\_filter
- thelia.parser.register\_output\_filter

Exemple :

```

```

### Configuration File

[](#configuration-file)

To add the filter in the database ( and activate it ) you have to create a configuration file name smarty-filter.xml and your configuration in it as the exemple :

```

            EmailFilter
            Filtre pour sécurisation des emails
            output

```

Loop
----

[](#loop)

\[smarty\_filter\]

### Input arguments

[](#input-arguments)

ArgumentDescriptionidfilter by on or more IDfiltertypefilter by one or more type ( pre, post or output)orderorder the result (alpha, alpha-reverse, random , given\_id )### Output arguments

[](#output-arguments)

VariableDescription$IDfilter's ID$IS\_TRANSLATEDcheck translation for the filter$LOCALEthe locale$TITLEtitle string$DESCRIPTIONdescription string$ACTIVATEboolean to check filter enabled or not$TYPEfilter type ( pre, post, output)### Exemple

[](#exemple)

```
{loop name="smarty_filter" type="smarty_filter"}

            {$TITLE}

            {$DESCRIPTION}

            {$CODE}

            {$TYPE}

{/loop}

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 95% 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 ~13 days

Total

4

Last Release

3983d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2196919?v=4)[thelia](/maintainers/thelia)[@thelia](https://github.com/thelia)

---

Top Contributors

[![Soldras](https://avatars.githubusercontent.com/u/11573385?v=4)](https://github.com/Soldras "Soldras (19 commits)")[![lunika](https://avatars.githubusercontent.com/u/767834?v=4)](https://github.com/lunika "lunika (1 commits)")

### Embed Badge

![Health badge](/badges/thelia-smarty-filter-module/health.svg)

```
[![Health](https://phpackages.com/badges/thelia-smarty-filter-module/health.svg)](https://phpackages.com/packages/thelia-smarty-filter-module)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

555.8M69](/packages/symfony-ux-icons)[nystudio107/craft-twigpack

Twigpack is a bridge between Twig and webpack, with manifest.json &amp; webpack-dev-server HMR support

97341.4k17](/packages/nystudio107-craft-twigpack)

PHPackages © 2026

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