-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
template_from_string bug with "use" #877
Comments
|
Hum ? Why not ? |
But |
The documentation said use take a template argument. |
Here is the message I see in the doc of the
|
Ok, that's annoying. |
closing. this might be possible in Twig 2.0 though. |
I'm using Twig 3.3 in Symfony 5.2.3, it's still not possible. :( |
{% use template_from_string("{% block body %}Go{% endblock %}") %}
Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'The template references in a "use" statement must be a string in "event:dynamic" at line 3.' in /_vendor/TwigLibrary/lib/Twig/TokenParser/Use.php:41 Stack trace:
#0 /_vendor/TwigLibrary/lib/Twig/Parser.php(192): Twig_TokenParser_Use->parse(Object(Twig_Token))
#1 /_vendor/TwigLibrary/lib/Twig/Parser.php(100): Twig_Parser->subparse(NULL, false)
#2 /_vendor/TwigLibrary/lib/Twig/Environment.php(486): Twig_Parser->parse(Object(Twig_TokenStream))
#3 /_vendor/TwigLibrary/lib/Twig/Environment.php(536): Twig_Environment->parse(Object(Twig_TokenStream))
#4 /_vendor/TwigLibrary/lib/Twig/Environment.php(330): Twig_Environment->compileSource('{% extends "lay...', 'event:dynamic') # in /_vendor/TwigLibrary/lib/Twig/TokenParser/Use.php on line 41
The text was updated successfully, but these errors were encountered: