Symfony "Unknown knp_menu_render function" 投入生产
Symfony "Unknown knp_menu_render function" on production
传输到生产服务器时出现此错误。
[2016-04-27 18:45:23] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2016-04-27 18:45:24] request.CRITICAL: Uncaught PHP Exception Twig_Error_Syntax: "Unknown "knp_menu_render" function in "dailyShop/index.html.twig" at line 210." at /home/ashkov/www/ruproms.ru/vendor/twig/twig/lib/Twig/ExpressionParser.php line 573 {"exception":"[object] (Twig_Error_Syntax(code: 0): Unknown \"knp_menu_render\" function in \"dailyShop/index.html.twig\" at line 210. at /home/ashkov/www/ruproms.ru/vendor/twig/twig/lib/Twig/ExpressionParser.php:573)"} []
开发环境一切正常
composer update 做了好几次。
new Knp\Bundle\MenuBundle\KnpMenuBundle(),在 app/AppKernel.php
中的位置
这解决了问题:
php bin/console cache:clear -e prod
传输到生产服务器时出现此错误。
[2016-04-27 18:45:23] security.INFO: Populated the TokenStorage with an anonymous Token. [] []
[2016-04-27 18:45:24] request.CRITICAL: Uncaught PHP Exception Twig_Error_Syntax: "Unknown "knp_menu_render" function in "dailyShop/index.html.twig" at line 210." at /home/ashkov/www/ruproms.ru/vendor/twig/twig/lib/Twig/ExpressionParser.php line 573 {"exception":"[object] (Twig_Error_Syntax(code: 0): Unknown \"knp_menu_render\" function in \"dailyShop/index.html.twig\" at line 210. at /home/ashkov/www/ruproms.ru/vendor/twig/twig/lib/Twig/ExpressionParser.php:573)"} []
开发环境一切正常
composer update 做了好几次。
new Knp\Bundle\MenuBundle\KnpMenuBundle(),在 app/AppKernel.php
中的位置这解决了问题:
php bin/console cache:clear -e prod