By star-szr on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Issue links:
Description:
In Twig templates, render arrays are automatically rendered when printed. But there are use cases for rendering and then passing a render array on to other Twig filters.
A render filter has been added so that render arrays can be rendered by passing them to the filter.
Examples of how to meet this use case before:
{# Example method 1: Set block. #}
{% set foo %}
{{ content.body }}
{% endset %}
{{ foo|length }}
{# Example method 2: Using the render_var Twig function. #}
{{ render_var(content.body)|length }}
Example after:
{{ content.body|render|length }}
Impacts:
Themers