Skip to content

Commit

Permalink
--fix Twig2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
adambalint-srg committed Feb 9, 2017
1 parent fe2b3a0 commit fbf4605
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Mandango/Mondator/ClassExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,9 @@ protected function processTemplate(Definition $definition, $name, array $variabl
$variables['class'] = $this->class;
$variables['config_class'] = $this->configClass;
$variables['config_classes'] = $this->configClasses;

$result = $twig->loadTemplate($name)->render($variables);

$template = $twig->createTemplate($name);
$result = $template->render($variables);

// properties
$expression = '/
Expand Down Expand Up @@ -409,7 +410,7 @@ public function getTwig()
throw new \RuntimeException('Twig is required to use templates.');
}

$loader = new \Twig_Loader_String();
$loader = new \Twig_Loader_Array();
$twig = new \Twig_Environment($loader, array(
'autoescape' => false,
'strict_variables' => true,
Expand Down

0 comments on commit fbf4605

Please sign in to comment.