Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
qianxun committed Dec 23, 2017
1 parent 5c3d719 commit 262a885
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ app.use(function*(){
});
```

### use for koa2

```javascript
var app = require('xtpl/lib/koa')(require('koa')(),{
views:'./views'
});
app.use( async (ctx, next){
   ctx.body = await ctx.render('test',{data: 1});   //需要把渲染完的字符串传给body
});
```

## Example

├── footer.xtpl
Expand Down Expand Up @@ -238,4 +249,4 @@ https://github.com/xtemplate/xtpl/milestones

## License

xtpl is released under the MIT license.
xtpl is released under the MIT license.

0 comments on commit 262a885

Please sign in to comment.