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
I render templates in browser from strings like this:
const imp = '{% import _self as _macro %}'; const macro = ` {% macro testMacro(global) %} <span>testMacro content</span> {% endmacro %} `; const template = ` <div> {{ _macro.testMacro(_context) }} global.example: {{ global.example ?? 'null' }} example: {{ example ?? 'null' }} dump: {{ dump(_context) }} </div> `; const data = { example: 'test' }; Twig.cache(); const tw = Twig.twig({ id: 'test.html', data: `${ macro }${ imp } ${ template }` }); tw.renderAsync(data).then((output) => { console.log('output', output) });
And its broken with version 1.14.0. All variables puts in global object ('global' is name of first argument in macro).
global
I get
<div> <span>testMacro content</span> global.example: test example: null dump: object(2) { [_self] => object(1) { [testMacro] => function() } [global]=> object(2) { [example] => string(4) "test" [_macro] => object(1) { [testMacro] => function() } } } </div>
With version 1.13.3 all works fine.
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
No branches or pull requests
I render templates in browser from strings like this:
And its broken with version 1.14.0. All variables puts in
global
object ('global' is name of first argument in macro).I get
With version 1.13.3 all works fine.
The text was updated successfully, but these errors were encountered: