I think there are a cases where you want to get the number of elements in an array.
Twig uses a filter to get the number of elements.
Officail: Documentation — Length
{% if users|length > 10 %} ... {% endif %}
Use length
.
Well, that’s it.
I think there are a cases where you want to get the number of elements in an array.
Twig uses a filter to get the number of elements.
Officail: Documentation — Length
{% if users|length > 10 %} ... {% endif %}
Use length
.
Well, that’s it.