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:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user