Updates to add universal key to any field

This commit is contained in:
Andy Miller
2017-05-23 12:55:02 -06:00
parent 1923d9d668
commit 4afefc455a
2 changed files with 16 additions and 0 deletions

View File

@@ -50,6 +50,9 @@
{# required attribute structures #}
name="{{ field_name }}"
value="{{ value|join(', ') }}"
{% if field.key %}
data-key-observe="{{ (scope ~ field_name)|fieldName }}"
{% endif %}
{# input attribute structures #}
{% block input_attributes %}
{% if field.classes is defined %}class="{{ field.classes }}" {% endif %}

View File

@@ -80,6 +80,12 @@
include 'forms/fields/key/key.html.twig'
with { field: child, value: key }
%}
{% elseif child.key == true %}
{% include [
"forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/key/key.html.twig'
] with { field: child, value: key }
%}
{% elseif child.type %}
{% set originalValue = childValue %}
{%
@@ -136,6 +142,13 @@
include 'forms/fields/key/key.html.twig'
with { field: child, value: null }
-%}
{%- elseif child.key == true -%}
{%-
include [
"forms/fields/#{child.type}/#{child.type}.html.twig",
'forms/fields/key/key.html.twig'
] with { field: child, value: null }
-%}
{%- elseif child.type -%}
{%-
include [