Executing closure on Twig

前端 未结 3 1412
梦谈多话
梦谈多话 2021-01-13 08:51

I\'m trying to execute a closure that resides inside an array on a Twig template. Below you could find a simplified snippet of which I\'m trying:


//Sym         


        
3条回答
  •  生来不讨喜
    2021-01-13 09:20

    You cannot directly execute a closure inside your Twig template. However, if you need to call some PHP inside your template, you should use create a Twig Extension and include your logic inside.

提交回复
热议问题