I'm using twig in my Symfony2 project to render templates form variable:
$env = new \Twig_Environment(new \Twig_Loader_String());
$render = $env->render(
$renderString,
$params
);
But when I trying to use Symfony twig functions(such as 'path', 'url', 'asset', 'controller', etc) it throws exception "The function "path" does not exist in...". There is the way to inject this function to the Twig_Environment?