fixed the include function when used in an assignment (closes #1095)

This commit is contained in:
Fabien Potencier
2013-05-17 12:06:31 +02:00
parent f6ebd46fad
commit ba88c75557
3 changed files with 15 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
* 1.13.1 (2013-XX-XX)
* n/a
* fixed the include function when used in an assignment
* 1.13.0 (2013-05-10)
+1 -1
View File
@@ -1295,7 +1295,7 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a
}
try {
return $env->resolveTemplate($template)->display($variables);
return $env->resolveTemplate($template)->render($variables);
} catch (Twig_Error_Loader $e) {
if (!$ignoreMissing) {
throw $e;
@@ -0,0 +1,13 @@
--TEST--
"include" function
--TEMPLATE--
{% set tmp = include("foo.twig") %}
FOO{{ tmp }}BAR
--TEMPLATE(foo.twig)--
FOOBAR
--DATA--
return array()
--EXPECT--
FOO
FOOBARBAR