1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-05 20:57:41 +02:00

Flextype Core: I18nTwigExtension - new filter tr added.

This commit is contained in:
Awilum
2019-08-11 11:45:53 +03:00
parent 3423d460df
commit 25e7bf52cd

View File

@@ -12,6 +12,7 @@ namespace Flextype;
use Flextype\Component\I18n\I18n;
use Twig_Extension;
use Twig_SimpleFunction;
use Twig_SimpleFilter;
class I18nTwigExtension extends Twig_Extension
{
@@ -27,6 +28,18 @@ class I18nTwigExtension extends Twig_Extension
];
}
/**
* Returns a list of filters to add to the existing list.
*
* @return array
*/
public function getFilters() : array
{
return [
new Twig_SimpleFilter('tr', [$this, 'tr']),
];
}
/**
* Translate string
*/