Reputation: 2677
I'm using twig and want to check if the given variable xyz has more than x entries. How is that possible?
Thanks!
Upvotes: 2
Views: 2128
Reputation: 1754
Yes, the length filter is the way to go.
{% if xyz | length > x %}
{% do something %}
{% endif %}
Upvotes: 4