Closed neti-soft closed 7 years ago
I suppose I should be able to add global-type variables into locals and have access to them in each template, without passing them to render function. Can you confirm that, and if it is true fix that ASAP. Thanks)
example code: ejs(app, { root: path.join(__dirname, '/../view'), layout: 'layout', viewExt: 'html', cache: true, debug: false, locals: { test: "some global variable" } });
you can use this.state instead. I have trouble with this for long time.
this.state
Refer to ctx.state in koa.
ctx.state
I suppose I should be able to add global-type variables into locals and have access to them in each template, without passing them to render function. Can you confirm that, and if it is true fix that ASAP. Thanks)
example code: ejs(app, { root: path.join(__dirname, '/../view'), layout: 'layout', viewExt: 'html', cache: true, debug: false, locals: { test: "some global variable" } });