开发者

Twig "trans" tag broke after upgrading to 1.0

开发者 https://www.devze.com 2023-03-08 01:47 出处:网络
I\'m updating a PHP system using Twig with I18n extension to the latest twig 1.0.0-77. The problem is that Twig can\'t find Twig_Extension_I18n, when I move it and related files to the appropriate f

I'm updating a PHP system using Twig with I18n extension to the latest twig 1.0.0-77.

The problem is that Twig can't find Twig_Extension_I18n, when I move it and related files to the appropriate folders from the old version, I get an interface error so it seems that the issue can't be fixed that way.

The "trans" tag has stopped working as w开发者_JAVA百科ell, but since there's a lot of views using that tag, I need it in exact same syntax.

So how do I make the "trans" tag work in the latest twig?

Thanks


Fabpot has moved that extension into it's own extension repo on Github. To use it you'll need to run the autoloader for initializing Twig with those extensions.

require( "/path/to/Twig-extensions/lib/Twig/Extensions/Autoloader.php" );
Twig_Extensions_Autoloader::register();
0

精彩评论

暂无评论...
验证码 换一张
取 消