It is necessary to hide elements that have a year less than the current year in the data-value , as it can be done. The php is not very strong. It is advisable to do inside the call. value substitutes year

 {% for value, string in form.ccYear %} <a href="#" data-value="{{ value }}">{{ string }}</a> {% endfor %} 

    1 answer 1

     {% for value, string in form.ccYear %} {% if value >= "now"|date("Y") %} <a href="#" data-value="{{ value }}">{{ string }}</a> {% endif %} {% endfor %}