我阅读了文档,我不清楚这是正确的。我知道你可以使用嵌套for循环,但如果语句似乎不同。Jinja2是否支持嵌套if语句?
我可以做以下吗?
{% if thing=true %}
<div> something here</div>
{% if diffthing=true %}
<div> something else</div>
{% else %}
<div> third thing</div>
{% endif %}
{% else %}
<div> nothing here </div>
{% endif %}
或者应该格式有所不同?
我看到了 - 不一定是嵌套 – ShanaC