只需使用诸如
{{ var|string() }}或https://stackoverflow.com/a/19993378/1232796的过滤器{{ var|int() }}在你的情况下,你想做
{% if profile|string() == element.author|string() %}{{ profile }} and {{ element.author }} are same{% else %}{{ profile }} and {{ element.author }} are **not** same{% endif %}


