{% set html = form_generator %} {% macro widget(field) %} {%- set macro = {'input': input}[field.properties.widget] -%} {{- macro(field) -}} {% endmacro %} {% macro input(field) %} {%- do html.begin(auto_domid=true, auto_for=true) %}
{{ html.label(field, contents=field.label) }} {{ html.input(field, type=field.properties.type) }}
{%- do html.end() %} {% endmacro %}