根据所给数据编译模板立即渲染出结果
juicer(tpl,data)
仅编译暂不渲染
var compiled_tpl = juicer(tpl)
根据所给的数据对编译好的模板进行渲染
var html = compiled_tpl.render(data)
注册自定义函数
juicer.register('function_name',function(){})
注销自定义函数
juicer.unregister('function_name')
修改配置文件
juicer.set(...)
juicer语法:
${name}
执行自定义函数${name|function}
参数${name|function,arg1,arg2}
避免转义
$${name}
内联辅助函数{@helper}...{@/helper}
遍历
{@each list as item,index}
...
{@/each}
判断语句
{@if}...{@else if}...{@else}...{@/if}
注释
{# ...}
辅助循环
{@each i in range(m,n)}
例子:
{each i in range(5,10)}
${i}; //输出5,6,7,8,9
{@/each}
子模板嵌套{@include tpl,data}