Closed juanmaia closed 8 years ago
I can't access ANY locals var inside template.
Ok, now I see: https://github.com/baryshev/ect/issues/34 so it's known issue apparently
@igorkova you just need to prefix all locals inside a template with @.
It's express question. You can access it trough locals:
app.use(function(req, res, next) {
res.locals.req = req;
return next();
});
But you probably do not need all req
, so you can pass whatever you want. Look trough express issue if will have any troubles with session.
I'm using ect with express. Is it possible to access req.session inside a template?
<%- req.session.user %>
or<%- @req.session.user %>