Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twig_Error_Runtime exception with "url" function

after updating twig to > than 1.7

code <a href="{{ url('article', { 'articleId':article.id }) }}"> causes:

Twig_Error_Runtime: An exception has been thrown during the compilation of a template ("Catchable Fatal Error: Argument 2 passed to Twig_Environment::addFunction() must implement interface Twig_FunctionInterface, instance of Twig_Filter_Function given

with 1.7 - everything is ok

like image 613
Volodymyr Fertak Avatar asked Nov 04 '22 14:11

Volodymyr Fertak


1 Answers

You have to use path(...) instead of url(...).
Arguments are the same.

I suppose that from 1.7 to > 1.7 this function became obsolete and was substituted with new one

like image 55
DonCallisto Avatar answered Nov 15 '22 10:11

DonCallisto