"locals" is not working
neti-soft opened this issue · comments
neti commented
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"
}
});
bughunter commented
you can use this.state
instead. I have trouble with this for long time.
Runrioter Wung commented
Refer to ctx.state
in koa.