So I have a twig template that's basically empty, and the application generates some twig code and passes this as a variable into a twig template, like this:
return $this->render('blank.html.twig', [
'twig' => $this->generateTwig()
]);
blank.html.twig looks like this:
{{ twig }}
But when the template is rendered it just has un-rendered twig code inside, like this:
{% extends 'base.html.twig' %} {% block content %} <h1>{{ 'app-name'|trans }}...
How do you render the injected twig code in this example?
Doing a file_put_contents('blank', $this->generateTwig()) works, but this defeats the purpose of using templates.