-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
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
Simply twig.js in a browser #711
Comments
As a note: One needs to be careful when including a template especially when one also has TWIG templating on the server side. |
There might be a bug in the replace filter. The code should display only the extension "JPG". |
Does Unsure that's implemented in twig.js, but I could be wrong. |
Strangely the REPLACE works the first time but the second time looks like it still uses the data from the previous REPLACE call. Ex: Might be a variable scope issue. |
This is due to a deeper issue with how expressions are parsed and tokenized. For some reason the are being resolved to static values and cached instead of being kept dynamic and evaluated on each render. |
Hi,
I have spent many, many hours to try to make twig.js work in a browser. Unsuccessful :(
All I want is to be able to include the twig.js file and then render some templates.
I have many years of experience in development but it looks like this just got the better of me.
I do one rendering and it renders fine. Then when I'm doing the second rendering of the same template, data from the first rendering is used. The issue is in the .replace filter.
Also I tried this simple code and it's not working. I might be doing something wrong.
I include twig.min.js version 1.14.0 from here: https://asset-packagist.org/package/npm-asset/twig
The code I use:
Thank you, I really appreciate any help,
Daniel
The text was updated successfully, but these errors were encountered: