This commit is contained in:
2019-04-02 19:54:29 +02:00
parent 14139c7bc8
commit 03694c1aa6
101 changed files with 11348 additions and 2 deletions

View File

@ -0,0 +1,17 @@
{%- macro render_field(form, fields, scope) %}
{%- for index, field in fields %}
{%- set input = attribute(field, "input@") %}
{%- if input is null or input == true %}
{%- set value = form.value(scope ~ (field.name ?? index)) %}
{{- scope ~ (field.name ?? index) }}: {{ string(value is iterable ? value|json_encode : value|escape('yaml')) ~ "\r\n" }}
{%- else %}
{%- if field.fields %}
{%- set new_scope = field.nest_id ? scope ~ field.name ~ '.' : scope -%}
{{- _self.render_field(form, field.fields, new_scope) }}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endmacro %}
{%- autoescape false %}
{{- _self.render_field(form, form.fields, '') ~ "\r\n" }}
{%- endautoescape %}