length Twig Filter

The length filter returns the number of items of a sequence or mapping or the length of a string.

Examples

Outputting the length.

{{ variable|length }}

Using the length in a test.

{% if variable|length > 0 %}
...
{% endif %}
This documentation is only for Aptuitiv CMS. Learn more.
Get Started With Aptuitiv