فهرست منبع

Merge pull request #822 from uwej711/form_label

Form label
Thomas 13 سال پیش
والد
کامیت
27b0120ed1
2فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 4 1
      Resources/views/Form/form_admin_fields.html.twig
  2. 4 1
      Resources/views/Form/silex_form_div_layout.html.twig

+ 4 - 1
Resources/views/Form/form_admin_fields.html.twig

@@ -10,8 +10,11 @@ file that was distributed with this source code.
 #}
 
 {# Labels #}
-{% block generic_label %}
+{% block form_label %}
 {% spaceless %}
+    {% if not compound %}
+        {% set attr = attr|merge({'for': id}) %}
+    {% endif %}
     {% if required %}
         {% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %}
     {% endif %}

+ 4 - 1
Resources/views/Form/silex_form_div_layout.html.twig

@@ -38,8 +38,11 @@
 
 {# Labels #}
 
-{% block generic_label %}
+{% block form_label %}
 {% spaceless %}
+    {% if not compound %}
+        {% set attr = attr|merge({'for': id}) %}
+    {% endif %}
     {% if required %}
         {% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %}
     {% endif %}