diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
index e1d09153dfe60..64377bb9f7d09 100644
--- a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
+++ b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
@@ -79,7 +79,7 @@
{{- block('choice_widget_options') -}}
{%- else -%}
-
+
{%- endif -%}
{% endfor %}
{%- endblock choice_widget_options -%}
@@ -242,7 +242,7 @@
{% set label = name|humanize %}
{%- endif -%}
{%- endif -%}
-
+
{%- endif -%}
{%- endblock form_label -%}
@@ -334,44 +334,17 @@
id="{{ id }}" name="{{ full_name }}"
{%- if disabled %} disabled="disabled"{% endif -%}
{%- if required %} required="required"{% endif -%}
- {%- for attrname, attrvalue in attr -%}
- {{- " " -}}
- {%- if attrname in ['placeholder', 'title'] -%}
- {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
- {%- elseif attrvalue is same as(true) -%}
- {{- attrname }}="{{ attrname }}"
- {%- elseif attrvalue is not same as(false) -%}
- {{- attrname }}="{{ attrvalue }}"
- {%- endif -%}
- {%- endfor -%}
+ {{ block('attributes') }}
{%- endblock widget_attributes -%}
{%- block widget_container_attributes -%}
{%- if id is not empty %}id="{{ id }}"{% endif -%}
- {%- for attrname, attrvalue in attr -%}
- {{- " " -}}
- {%- if attrname in ['placeholder', 'title'] -%}
- {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
- {%- elseif attrvalue is same as(true) -%}
- {{- attrname }}="{{ attrname }}"
- {%- elseif attrvalue is not same as(false) -%}
- {{- attrname }}="{{ attrvalue }}"
- {%- endif -%}
- {%- endfor -%}
+ {{ block('attributes') }}
{%- endblock widget_container_attributes -%}
{%- block button_attributes -%}
id="{{ id }}" name="{{ full_name }}"{% if disabled %} disabled="disabled"{% endif -%}
- {%- for attrname, attrvalue in attr -%}
- {{- " " -}}
- {%- if attrname in ['placeholder', 'title'] -%}
- {{- attrname }}="{{ translation_domain is same as(false) ? attrvalue : attrvalue|trans({}, translation_domain) }}"
- {%- elseif attrvalue is same as(true) -%}
- {{- attrname }}="{{ attrname }}"
- {%- elseif attrvalue is not same as(false) -%}
- {{- attrname }}="{{ attrvalue }}"
- {%- endif -%}
- {%- endfor -%}
+ {{ block('attributes') }}
{%- endblock button_attributes -%}
{% block attributes -%}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php
index eb421be817691..a9bd62f2a1b9e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/attributes.html.php
@@ -1 +1,9 @@
-block($form, 'widget_attributes') ?>
+ $v): ?>
+
+escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
+
+escape($k), $view->escape($k)) ?>
+
+escape($k), $view->escape($v)) ?>
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php
index 56b3dd92846d3..279233baa3fc0 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php
@@ -1,10 +1,2 @@
-id="escape($id) ?>" name="escape($full_name) ?>" disabled="disabled"
- $v): ?>
-
-escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
-
-escape($k), $view->escape($k)) ?>
-
-escape($k), $view->escape($v)) ?>
-
-
+id="escape($id) ?>" name="escape($full_name) ?>" disabled="disabled"
+block($form, 'attributes') : '' ?>
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php
index 7a51b2ce7b4ff..78c953ec5a1f3 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_label.html.php
@@ -4,5 +4,5 @@
$name, '%id%' => $id))
: $view['form']->humanize($name); } ?>
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
index 3fefa47c15c99..41c0cc7bfe8ba 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
@@ -1,11 +1,3 @@
id="escape($id) ?>" name="escape($full_name) ?>" disabled="disabled"
required="required"
- $v): ?>
-
-escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
-
-escape($k), $view->escape($k)) ?>
-
-escape($k), $view->escape($v)) ?>
-
-
+block($form, 'attributes') : '' ?>
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php
index c4dff7b61f4e0..fdd176d12c79f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php
@@ -1,10 +1,2 @@
-id="escape($id) ?>"
- $v): ?>
-
-escape($k), $view->escape(false !== $translation_domain ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
-
-escape($k), $view->escape($k)) ?>
-
-escape($k), $view->escape($v)) ?>
-
-
+id="escape($id) ?>"
+block($form, 'attributes') : '' ?>