By dawehner on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Description:
To support the use of Twig syntax in render arrays, a new inline_template render element has been added:
$build['string'] = [
'#type' => 'inline_template',
'#template' => '<span class="x">{{ var }}</span>',
'#context' => [
'var' => $possible_unsafe_var,
],
];
Related change records
See Twig autoescape enabled and text sanitization APIs updated for a full list of related change records and for other strategies for combining strings safely.
Impacts:
Module developers
Themers