Skip to content

Instantly share code, notes, and snippets.

@jiceb
Last active December 18, 2015 13:48
Show Gist options
  • Save jiceb/5792314 to your computer and use it in GitHub Desktop.
Save jiceb/5792314 to your computer and use it in GitHub Desktop.
Twig tips
{#
title: Combines a loop with a logical if statement
url: http://symfony.com/doc/current/book/templating.html
#}
<ul>
{% for user in users if user.active %}
<li>{{ user.username }}</li>
{% else %}
<li>No users found</li>
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment