$this->twig->
addGlobal('context',
$context);
if ($this->twig->
hasExtension(EscaperExtension::
class)) { /** @var EscaperExtension $escaperExtension */
$escaperExtension =
$this->twig->
getExtension(EscaperExtension::
class);
$escaperExtension->
setDefaultStrategy($htmlEscape ? 'html' : false
);
} try { return $this->twig->
render($name,
$data);
} catch (Error
$error) { throw new StringTemplateRenderingException($error->
getMessage());
} } public function enableTestMode(): void
{ $this->twig->
addGlobal('testMode', true
);
$this->twig->
disableStrictVariables();
} public function disableTestMode(): void
{