Skip to content

escape string in extension #4100

Answered by fabpot
connorhu asked this question in Q&A
May 24, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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');

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@connorhu
Comment options

Answer selected by connorhu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants