Twig 模板引擎

匹配字符串
{% if '皮肤' in '皮肤23213'  %}1{% else %}2{% endif %}
时间格式转换
{{ time|date('Y-m-d H:i:s') }}
提取需要长度的字符串
{{ app.session.get(‘city_name’)[0:2] }}(如北京市提取出北京)
原文地址:https://www.cnblogs.com/linzy/p/7654656.html