From 395dbcc043331af2f16316c2de9d5be3564cd7d0 Mon Sep 17 00:00:00 2001 From: Yannick Snobbert Date: Tue, 30 Jun 2015 10:52:00 +0200 Subject: [PATCH] Reduces code duplication in form_layout --- .../views/Form/form_div_layout.html.twig | 33 ++----------------- 1 file changed, 3 insertions(+), 30 deletions(-) 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 13603812c09a5..3c6fbacebd9b2 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 @@ -317,44 +317,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 }}="{{ attrvalue|trans({}, translation_domain) }}" - {%- elseif attrvalue is sameas(true) -%} - {{- attrname }}="{{ attrname }}" - {%- elseif attrvalue is not sameas(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 }}="{{ attrvalue|trans({}, translation_domain) }}" - {%- elseif attrvalue is sameas(true) -%} - {{- attrname }}="{{ attrname }}" - {%- elseif attrvalue is not sameas(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 }}="{{ attrvalue|trans({}, translation_domain) }}" - {%- elseif attrvalue is sameas(true) -%} - {{- attrname }}="{{ attrname }}" - {%- elseif attrvalue is not sameas(false) -%} - {{- attrname }}="{{ attrvalue }}" - {%- endif -%} - {%- endfor -%} + {{ block('attributes') }} {%- endblock button_attributes -%} {% block attributes -%} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy