Download the PHP package thelia/smarty-filter-module without Composer
On this page you can find all versions of the php package thelia/smarty-filter-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package smarty-filter-module
Smarty Filter
Allows you to add some filters in smarty render. See the documentation about what is a Smarty filter : prefilter/postfilter or outputfilter
Installation
Manually
- Copy the module into directory and be sure that the name of the module is SmartyFilter.
- Activate it in your thelia administration panel
Composer
Add it in your main thelia composer.json file
Usage
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
You can add your filter in others module and use this module to integrate it. There are 3 steps to check.
Service
First create a class with a public method named filter. Add your filter in it.
Exemple :
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
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 :
Loop
[smarty_filter]
Input arguments
Argument | Description |
---|---|
id | filter by on or more ID |
filtertype | filter by one or more type ( pre, post or output) |
order | order the result (alpha, alpha-reverse, random , given_id ) |
Output arguments
Variable | Description |
---|---|
$ID | filter's ID |
$IS_TRANSLATED | check translation for the filter |
$LOCALE | the locale |
$TITLE | title string |
$DESCRIPTION | description string |
$ACTIVATE | boolean to check filter enabled or not |
$TYPE | filter type ( pre, post, output) |