mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 03:16:34 +00:00
bug #2760 Make sure twig_include returns a string (thewilkybarkid)
This PR was merged into the 1.x branch.
Discussion
----------
Make sure twig_include returns a string
Currently returns `null` if `$ignoreMissing` is `true` and it's not found, but the return type is `string`.
Commits
-------
a55f76bf Make sure twig_include returns a string
This commit is contained in:
@@ -1527,7 +1527,7 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a
|
||||
}
|
||||
}
|
||||
|
||||
$result = null;
|
||||
$result = '';
|
||||
try {
|
||||
$result = $env->resolveTemplate($template)->render($variables);
|
||||
} catch (Twig_Error_Loader $e) {
|
||||
|
||||
Reference in New Issue
Block a user