Generating template in controller and simulate |raw filter

Viewed 26

I have to code a method which takes a string and generate html code

/** @var Environment */
private Environment $templating;


$t = $this->templating->createTemplate($template);
$html = $t->render($parameters);

It works nicely, except it doesn't render html code. The only way is to add in $template the filter |raw.

I can't use the filter in the template because template will be created by users. I have to find a way to automatically render the html.

I don't find a way to do it, then I need your help

0 Answers
Related