如何在symfony2.3中修复twig扩展名弃用

DEPRECATION - The Twig_Filter_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleFilter instead.


Called from require() at line 92
Called from DebugClassLoader::loadClass()
Called from spl_autoload_call() at line 42
Called from DoctrineExtension::getFilters() at line 3432
Called from Twig_Environment::initExtension() at line 3426
Called from Twig_Environment::initExtensions() at line 3377
Called from Twig_Environment::getUnaryOperators() at line 371
Called from Twig_Lexer::getOperatorRegex() at line 65

我的symfony被弃用了..
如何删除这个?…谢谢!

最佳答案 您需要做的就是找到在twig扩展中定义新过滤器的位置,并用新方法替换不常用的定义新过滤器的方法.如何执行此操作的示例是
https://github.com/schmittjoh/serializer/pull/484/files

点赞