-
There is an extension which, under certain conditions, either renders a template or returns only a string. When it returns a string, I want to escape it, but when the render is done, the render handles the escaping. Because of this, this extension runs with
Since the escape method is internal, I feel this is less trusted, but I couldn't find a better solution. What would be a nice, fast and safe solution in this case? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You use this instead (see https://github.com/twigphp/Twig/blob/3.x/doc/deprecated.rst): $escaper = $twig->getRuntime(EscaperRuntime::class);
return $escaper->escape($twig, self::stringValueForPresentationField($presentation, $field), 'html'); |
Beta Was this translation helpful? Give feedback.
You use this instead (see https://github.com/twigphp/Twig/blob/3.x/doc/deprecated.rst):