Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b249dca

Browse files
committed
[TwigBridge] fix high deps tests
1 parent b054aeb commit b249dca

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@
314314

315315
{%- block widget_attributes -%}
316316
id="{{ id }}" name="{{ full_name }}"
317-
{%- if read_only and attr.readonly is not defined %} readonly="readonly"{% endif -%}
317+
{%- if read_only %} readonly="readonly"{% endif -%}
318318
{%- if disabled %} disabled="disabled"{% endif -%}
319319
{%- if required %} required="required"{% endif -%}
320-
{%- for attrname, attrvalue in attr -%}
320+
{%- for attrname, attrvalue in attr if 'readonly' != attrname or not read_only -%}
321321
{{- " " -}}
322322
{%- if attrname in ['placeholder', 'title'] -%}
323323
{{- attrname }}="{{ attrvalue|trans({}, translation_domain) }}"

src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>" <?php if ($read_only && !isset($attr['readonly'])): ?>readonly="readonly" <?php endif ?>
1+
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>" <?php if ($read_only): ?>readonly="readonly" <?php endif ?>
22
<?php if ($disabled): ?>disabled="disabled" <?php endif ?>
33
<?php if ($required): ?>required="required" <?php endif ?>
44
<?php foreach ($attr as $k => $v): ?>
5+
<?php if ('readonly' === $k && $read_only): continue; endif ?>
56
<?php if (in_array($k, array('placeholder', 'title'), true)): ?>
67
<?php printf('%s="%s" ', $view->escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
78
<?php elseif ($v === true): ?>

0 commit comments

Comments
 (0)