Using a custom function in twig

后端 未结 4 1896
失恋的感觉
失恋的感觉 2021-02-02 10:21

In my template I want to output the server timezone.

My template has something like

{{ getservertimezone }}

Then in the services.yml co

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 10:51

    In the newer versions of Twig he should be using Twig_SimpleFunction instead of Twig_Function_Method and Twig_SimpleFilter instead of Twig_Filter_Method, since Twig_*_Method are deprecated (I am using Twig v. 1.24.0 along with Symfony 2.8.2)

提交回复
热议问题