Browse Source

Display custom form labels in filter view

Pascal Burkhard 14 years ago
parent
commit
022823ffdd
1 changed files with 8 additions and 1 deletions
  1. 8 1
      Resources/views/CRUD/base_filter_field.html.twig

+ 8 - 1
Resources/views/CRUD/base_filter_field.html.twig

@@ -10,7 +10,14 @@ file that was distributed with this source code.
 #}
 #}
 
 
 <div>
 <div>
-    {% block label %}{{ form_label(filter.field) }} <br />{% endblock %}
+    {% block label %}
+        {% if filter.description.options.name is defined %}
+            {{ form_label(filter.field, filter.description.options.name) }}
+        {% else %}
+            {{ form_label(filter.field) }}
+        {% endif %}
+        <br />
+    {% endblock %}
 
 
     <div class="sonata-ba-field {% if filter.field.haserrors %}sonata-ba-field-error"{% endif %}">
     <div class="sonata-ba-field {% if filter.field.haserrors %}sonata-ba-field-error"{% endif %}">
         {% block field %}{{ form_field(filter.field) }}{% endblock %}
         {% block field %}{{ form_field(filter.field) }}{% endblock %}