Returns True
if the length of the value is n
. Otherwise, it returns False
.
This is most useful in a condition.
Variable
veggies = ['Tomatoes', 'Cucumbers', 'Peas']
Template
{% if veggies|length_is:3 %} <p>Looks like a trio of veggies tonight!</p> {% endif %}
Result
<p>Looks like a trio of veggies tonight!</p>
Commentary
Maybe we are missing something, isn't using the
length
filter just as easy?