【发布时间】:2013-05-12 01:10:32
【问题描述】:
我正在使用 jinja2 在 Flask 中的 for-loop 中尝试一个简单的 continue
{% for num in range(0,10) %}
{% if num%2 == 0 %}
{% print num %}
{% else %}
{% continue %}
{% endif %}
我得到了这个错误
TemplateSyntaxError: Encountered unknown tag 'continue'. Jinja was looking for the following tags: 'endif'. The innermost block that needs to be closed is 'if'.
这是我遵循的 jinja2 文档...http://jinja.pocoo.org/docs/templates/#loop-controls
【问题讨论】:
标签: templates flask jinja2 continue