Skip to content

Commit fbf4605

Browse files
--fix Twig2 compatibility
1 parent fe2b3a0 commit fbf4605

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Mandango/Mondator/ClassExtension.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@ protected function processTemplate(Definition $definition, $name, array $variabl
340340
$variables['class'] = $this->class;
341341
$variables['config_class'] = $this->configClass;
342342
$variables['config_classes'] = $this->configClasses;
343-
344-
$result = $twig->loadTemplate($name)->render($variables);
343+
344+
$template = $twig->createTemplate($name);
345+
$result = $template->render($variables);
345346

346347
// properties
347348
$expression = '/
@@ -409,7 +410,7 @@ public function getTwig()
409410
throw new \RuntimeException('Twig is required to use templates.');
410411
}
411412

412-
$loader = new \Twig_Loader_String();
413+
$loader = new \Twig_Loader_Array();
413414
$twig = new \Twig_Environment($loader, array(
414415
'autoescape' => false,
415416
'strict_variables' => true,

0 commit comments

Comments
 (0)