Closed yiminghe closed 10 years ago
@yiminghe
感觉现在这种语法稍微有点奇怪,而且不能统一配置 layout
和 partials
的位置,想象中的调用方法应该是下面这样的:
var xtpl = require('xtpl/koa');
var app = koa();
app.use(xtpl({
views: __dirname + '/view',
partials: __dirname + '/view/partials',
layout: __dirname + '/view/layout'
}));
这样更符合中间件的思路,并且不用每次都去声明 {{extend ("./layout")}}
, 恩,个人的一点建议~
@dead-horse 怎么看,我觉得不需要制配置partial layout,模版就是和模块一样,extend include 指定路径的模版即可
嗯,模版中自己 extend 自己想要的 layout 好了,现在的中间件使用模式也符合 koa 的一类中间件用法,并且性能更高。