资 源 简 介
This script extends the String.prototype object with a render method that permits rendering objects using the given string as template in a Django-like style.
"{% for person in list|dicsort:name %}#{{forloop.counter}} {{ person.name|capfirst }}{% endfor %}".render({list:[{"name":"Cesar","firstname":"Jules"},{"name":"Mouse","firstname":"Mickey"}]})
Requires the XRegExp script that enhance the regular expressions.
Variables
Variables token can be written as {{ person.name }}
Filters can be applied {{ person.name|capfirst }}
Controls
for, adding a forloop.counter in the context
if,
Loop controls are written in the form
{% For person in list %}
{{ pers