Skip to content

Instantly share code, notes, and snippets.

@jacine
Created April 18, 2012 03:33
Show Gist options
  • Save jacine/2410927 to your computer and use it in GitHub Desktop.
Save jacine/2410927 to your computer and use it in GitHub Desktop.
Twig list template
<!-- Simple -->
<ul{{ items.attributes }}>
{% for item in items %}
<li{{ item.attributes }}> {{ item }} </li>
{% endfor %}
</ul>
<!-- Detailed -->
<ul{{ items.attributes }}>
{% for item in items %}
<li{{ item.attributes }}>
{% if item.href %}
<a href="{{ item.href }}"> {{ item.title }} </a>
{% else %}
{{ item }}
{% endif %}
</li>
{% endfor %}
</ul>
@jacine
Copy link
Author

jacine commented Apr 18, 2012

I kinda love this.

@chx is making it happen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment