Skip to content

Instantly share code, notes, and snippets.

@bobdenotter
Last active August 29, 2015 14:16
Show Gist options
  • Save bobdenotter/6be8e093eefa884ab4a6 to your computer and use it in GitHub Desktop.
Save bobdenotter/6be8e093eefa884ab4a6 to your computer and use it in GitHub Desktop.
Twig example
if you have a route like `/events/{year}/{month}/{day}`, use this in your template:
{% set date = app.request.get('year') ~ '-' ~ app.request.get('month') ~ '-' ~ app.request.get('day') %}
{% setcontent events = "events" where { 'date': date } %}
{% for event in events %}
..
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment