I am trying to use the bundle JMS Translation but I have this error. It is I guess because my version of twig is not the same the one of the bundle? What to do?
CRITICAL - Uncaught PHP Exception Twig_Error_Syntax: "The filter "truncate" does not exist in "...\vendor\jms\translation-bundle\JMS\TranslationBundle/Resources/views/Translate/messages.html.twig" at line 14" at ...\vendor\twig\twig\lib\Twig\ExpressionParser.php line 588
Here is my requirement in composer.json:
"require": {
...
"twig/extensions": "~1.2.0",
Here is what is in the composer of JMS Translation:
"conflict": {
"twig/twig": "1.10.2"
},
"require-dev": {
"symfony/twig-bundle": "*",
Thanks in advance!
Save this in a txt file and use ever!
composer require twig/extensions
$twig->addExtension(new Twig_Extensions_Extension_Text());
services:
twig.extension.text:
class: Twig_Extensions_Extension_Text
tags:
- { name: twig.extension }
Uncomment any lines below to activate that Twig extension
Twig\Extensions\ArrayExtension: null
Twig\Extensions\DateExtension: null
Twig\Extensions\IntlExtension: null
Twig\Extensions\TextExtension: null