I'm using Symfony 2.3 and have deprecation warnings in my profiler related to Twig. Such as:
DEPRECATION - Using "replace" with character by character replacement is deprecated
and will be removed in Twig 2.0
And the |replace
tag seems to be still part of the Twig documentation, so I am a little confused on how to deal with this Warning.
Also, I get similar Deprecation Warnings from third-party bundles that I use.
You need to change the way you pass the arguments to replace function in twig :
Before it was two arguments, now it's an array.
You can check in the code source that it's not the replace twig_replace_filter function wich is deprecated but only one way of calling it : https://github.com/twigphp/Twig/blob/1.x/lib/Twig/Extension/Core.php#L534
Note that the twig doc display the right example : http://twig.sensiolabs.org/doc/filters/replace.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With