-
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
support include function #392
Comments
@olets, it does? What am I missing? I get:
|
I've added this to the implementation notes on the wiki. https://github.com/twigjs/twig.js/wiki/Implementation-Notes |
Why was this closed? The include function is the recommended method of inclusion, according to the docs:
If this is still not supported, it should be reopened. |
Hello , any update here ? |
If someone is able to provide a TwigFiddle example that works and an example using this template that does not work, then I can look into it more. |
Hey @willrowe Here's the TwigFiddle showing the include() working as expected. Here's the TwigJS version erroring out. From the console:
|
Simple question: how can I use the include() function when the main template as been rendered from a string: Should include() get implemented as a callback function on my own when Twig render is called on a string instead of a filename ? |
@Geolim4 you can't use the |
Ohhh okay, so the readme is a bit lying then -_- |
What do you mean? |
The implementation note says that "include" is supported while its not actually :( |
@JohnAlbin did you update the implementation notes when you were under the impression that support had been added? |
@JohnAlbin great, thanks for the clarification. @Geolim4 the implementation notes are correct. It says that the |
This comment was marked as off-topic.
This comment was marked as off-topic.
@Geolim4 this issue is for adding support for the |
Still, the include tag is either unclear or not enough documented, so I think its indirectly related ? |
@Geolim4 this issue is a feature request. Please search through the existing issues and documentation. If there is nothing in there related to what you want to do then open a new issue. |
Hi @willrowe, are there any update on this |
@Dru-S I have not had a chance to work on this yet, but if you want to submit a PR I will review it. |
The
include()
functions is equivalent to theinclude
tag. It breaks twig.js with "Cannot call method 'replace' of undefined."Example:
{{ include('template.html', {foo: 'bar'}, with_context = false) }}
{% include 'template.html' with {'foo': 'bar'} only %}
http://twig.sensiolabs.org/doc/functions/include.html
edit following #392 (comment): I don't recall why this was closed. reopening
The text was updated successfully, but these errors were encountered: