Reputation: 93
How can I print not found when my hotel is empty using tiwg syntax
{% if hotels is empty %}
<p>not found</p>
{% else %}
{% for hotel in hotels %}
{% if %}
{% else %}
{% endif %}
{% else %}
{% endif %}
if my hotels is empty it didnt not found
Upvotes: 0
Views: 291
Reputation: 703
The twig doc of for loop mentions it very clearly.
Try this
{% for hotel in hotels %}
{% if %}
{% else %}
{% endif %}
{% else %}
<p>not found</p>
{% endfor %}
Thanks DarkBee for correcting me.
Upvotes: 1