浏览代码

Do not add form-control class to file inputs

Emmanuel Vella 10 年之前
父节点
当前提交
f276e94de1
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Resources/views/Form/form_admin_fields.html.twig

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

@@ -19,7 +19,10 @@ file that was distributed with this source code.
 {%- endblock form_widget %}
 
 {% block form_widget_simple %}
-    {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %}
+    {% set type = type|default('text') %}
+    {% if type != 'file' %}
+        {% set attr = attr|merge({'class': attr.class|default('') ~ ' form-control'}) %}
+    {% endif %}
     {{ parent() }}
 {% endblock form_widget_simple %}