You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #1706 and #1641 (comment) the way to render strings is as follows:
$string = 'Hello, {{ name }}';
$template = $env->createTemplate($string);
echo$template->render(array('name' => 'Bob')); // Hello, Bob
A common use case for this is customization based on user input. However if you render user input it could happen that the template is empty which leads to errors if you then call render on that template.
I am seeing the error as follows:
Template "__string_template__da47b0fa50ef004786efc7745172ce3402223a0f96b70d8f9d0bbbc2f70589a7" is not defined.
I would assume even if you pass an empty string as template everything should work, if I use a normal template the content could be empty as well. If someone confirms I might be able to look into this.
The text was updated successfully, but these errors were encountered:
As discussed in #1706 and #1641 (comment) the way to render strings is as follows:
A common use case for this is customization based on user input. However if you render user input it could happen that the template is empty which leads to errors if you then call render on that template.
I am seeing the error as follows:
I would assume even if you pass an empty string as template everything should work, if I use a normal template the content could be empty as well. If someone confirms I might be able to look into this.
The text was updated successfully, but these errors were encountered: