2019-02-15 django template for r
2019-02-15 本文已影响0人
多吃水果少吃肉
<!-- Iterate N times (replace N with a number -->
{% for i in "x"|ljust:"N" %}
<!-- Access numeric variable (0-based index) -->
{{ forloop.counter0 }}
<!-- Access numeric variable (1-based index) -->
{{ forloop.counter }}
{% endfor %}
<!-- For example, iterate from 0 to 3 -->
{% for i in "x"|ljust:"3" %}
<!-- Do stuff -->
{% endfor %}