12月14, 2017

nunjucks

普通输出

ctx.render('hello.html', {
        title: 'hello'
    });
 欢迎来到{{title}}页面

循环数组

ctx.render('list.html', {
        list: [{'a':'1'},{'b':'2'},{'c':'3'}]
    });
 {% for f in list %}
    <p>{{ f }}</p>
    {% endfor %}

本文链接:http://www.hijs.cc/post/nunjucks.html

-- EOF --

Comments