我怎样才能调用'时间差' Twig 中的函数
The code
{{ post.created_at|time_diff }}
Output
The filter "time_diff" does not exist
如果您使用 Symfony 2,
并想使用一些原生树枝延伸 https://github.com/twigphp/Twig-extensions
您必须将类似的服务声明为:
services:
twig.extension.date:
class: Twig_Extensions_Extension_Date
tags:
- { name: twig.extension }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)