koa-artpl

2.0.3 • Public • Published

koa-artpl

封装koa的art-template模板中间件

更新

解决变量未定义 视图渲染报错 支持基本的运算符

Installation

$ npm install koa-artpl

Use with koa

var artpl = require('koa-artpl');
 
artpl(app, {
    root: path.join(__dirname, 'view')
});
 
app.use(function *(next) {
    // set theme;
    this.theme = 'home';
 
    // helper
    this.template.helper('dateFormat', function(){
        return data;
    });
 
    this.body = yield this.render('index', {title: 'koa-artpl'});
});
 

Package Sidebar

Install

npm i koa-artpl

Weekly Downloads

2

Version

2.0.3

License

ISC

Last publish

Collaborators

  • einsqing