We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using other Express view engines (e.g. Jade) I am able to use [app.dynamicHelpers](http://expressjs.com/guide.html#app.dynamichelpers(\)) to make certain variables available to templates. For example:
app.dynamicHelpers({ foo: function(req, res) { return "Foo"; } })
is accessible in my templates as:
Hello, {{foo}}!
However, it appears that the matador.engine is not passing the dynamic helpers through to res.render.
I suspect that it's this line in matador.js, but I'm not confident enough with the source to know for sure, or to suggest a pull request:
return hogan.compile(source, options).render(options.locals, options.partials)
Inspecting options I see foo, however it is a child of options itself, and not options.locals.
options
foo
options.locals
The text was updated successfully, but these errors were encountered:
Hello,
I had the same problem. I figured a solution: it's putting: for(var i in options.app.dynamicViewHelpers) { options.locals[i] = options[i]; }
for(var i in options.app.dynamicViewHelpers) { options.locals[i] = options[i]; }
just before the line you showed us.
Sorry, something went wrong.
No branches or pull requests
Using other Express view engines (e.g. Jade) I am able to use [app.dynamicHelpers](http://expressjs.com/guide.html#app.dynamichelpers(\)) to make certain variables available to templates. For example:
is accessible in my templates as:
However, it appears that the matador.engine is not passing the dynamic helpers through to res.render.
I suspect that it's this line in matador.js, but I'm not confident enough with the source to know for sure, or to suggest a pull request:
Inspecting
options
I seefoo
, however it is a child ofoptions
itself, and notoptions.locals
.The text was updated successfully, but these errors were encountered: