Because of several reasons including translation of content i had to build a simple CMS to render the pages of my Symfony2 application.
My problem now is, that is se
twig_template_from_string function's source code is as follows:
function twig_template_from_string(Twig_Environment $env, $template)
{
return $env->createTemplate($template);
}
It means that if you already have a twig environment then it's better to call directly:
$template = $env->createTemplate($templateString);
$parsedContent = $template->render(array('a'=>'b'));