Skip to content

Commit 46edd06

Browse files
committed
feature #14403 [Form] deprecate read_only option (Tobion)
This PR was squashed before being merged into the 2.8 branch (closes #14403). Discussion ---------- [Form] deprecate read_only option | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #10658 | License | MIT | Doc PR | symfony/symfony-docs#3782 Replaces #10676 with a slightly different implementation. - fixes BC break when 'read_only' => true option and at the same time custom attributes are used by using a normalizer - adds deprecation notice - keeps legacy tests Commits ------- 53330e1 [Form] deprecate read_only option
2 parents dd801b5 + 9552e8a commit 46edd06

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>" <?php if ($read_only): ?>readonly="readonly" <?php endif ?>
2-
<?php if ($disabled): ?>disabled="disabled" <?php endif ?>
3-
<?php if ($required): ?>required="required" <?php endif ?>
1+
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>"<?php if ($disabled): ?> disabled="disabled"<?php endif ?>
2+
<?php if ($required): ?> required="required"<?php endif ?>
43
<?php foreach ($attr as $k => $v): ?>
54
<?php if (in_array($k, array('placeholder', 'title'), true)): ?>
6-
<?php printf('%s="%s" ', $view->escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
5+
<?php printf(' %s="%s"', $view->escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
76
<?php elseif ($v === true): ?>
8-
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
7+
<?php printf(' %s="%s"', $view->escape($k), $view->escape($k)) ?>
98
<?php elseif ($v !== false): ?>
10-
<?php printf('%s="%s" ', $view->escape($k), $view->escape($v)) ?>
9+
<?php printf(' %s="%s"', $view->escape($k), $view->escape($v)) ?>
1110
<?php endif ?>
1211
<?php endforeach ?>

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"symfony/finder": "~2.0,>=2.0.5|~3.0.0",
4242
"symfony/intl": "~2.3|~3.0.0",
4343
"symfony/security": "~2.6|~3.0.0",
44-
"symfony/form": "~2.7|~3.0.0",
44+
"symfony/form": "~2.8|~3.0.0",
4545
"symfony/class-loader": "~2.1|~3.0.0",
4646
"symfony/expression-language": "~2.6|~3.0.0",
4747
"symfony/process": "~2.0,>=2.0.5|~3.0.0",

0 commit comments

Comments
 (0)