Created
January 27, 2016 07:34
-
-
Save r3wt/57e63605654e0c5391a2 to your computer and use it in GitHub Desktop.
twig year select
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="year"> | |
<option value="">Not Selected</option> | |
{% for i in range(19,20) %} | |
{%for j in range(0,9) %} | |
{% for k in range (0,9) %} | |
{% set y %}{{i}}{{j}}{{k}}{%endset%} | |
{% if y <= "now"|date('Y') %} | |
<option value="{{y}}">{{y}}</option> | |
{% endif %} | |
{% endfor %} | |
{% endfor %} | |
{% endfor %} | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment