RenderInterface::render()
, RenderInterface::renderPlain()
and RenderInterface::renderRoot()
return a Markup
object which allows Twig to print them without auto-escaping the value.
Most code that calls a render method does not have to change. The only case where it might be required is if the result is used in an array key. If this is the case, the code should be refactored to not do this.
(Under the hood, the render array that is passed to either of those methods is getting its#markup
property set; those methods then simply return the set #markup
. It is in fact that #markup
that is being assigned a Markup
value.)