Skip to content

Commit 02f28b6

Browse files
committed
simplified Form templates as the safeguard is already set in the Form Type
1 parent 9d54633 commit 02f28b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
</div>
134134
{% else %}
135135
<select {{ block('attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
136-
{% if not multiple and empty_value is not none %}
136+
{% if empty_value is not none %}
137137
<option value="">{{ empty_value|trans }}</option>
138138
{% endif %}
139139
{% if preferred_choices|length > 0 %}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<?php if ($read_only): ?> disabled="disabled"<?php endif ?>
1313
<?php if ($multiple): ?> multiple="multiple"<?php endif ?>
1414
>
15-
<?php if (!$multiple && null !== $empty_value): ?><option value=""><?php echo $view->escape($view['translator']->trans($empty_value)) ?></option><?php endif; ?>
15+
<?php if (null !== $empty_value): ?><option value=""><?php echo $view->escape($view['translator']->trans($empty_value)) ?></option><?php endif; ?>
1616
<?php if (count($preferred_choices) > 0): ?>
1717
<?php foreach ($preferred_choices as $choice => $label): ?>
1818
<?php if ($view['form']->isChoiceGroup($label)): ?>

0 commit comments

Comments
 (0)