mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
fixed the include function when used in an assignment (closes #1095)
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user