8000 Alter upgrade notes with changes to _form_is_choice_selected twig fun… · symfony/symfony@9e3e589 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e3e589

Browse files
committed
Alter upgrade notes with changes to _form_is_choice_selected twig function
1 parent 826f512 commit 9e3e589

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

UPGRADE-2.1.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,9 @@
530530
by default. Take care if your JavaScript relies on that. If you want to
531531
read the actual choice value, read the `value` attribute instead.
532532
533-
* In the choice field type's template, the structure of the `choices` variable
534-
has changed.
535-
536-
The `choices` variable now contains `ChoiceView` objects with two getters,
537-
`getValue()` and `getLabel()`, to access the choice data.
533+
* In the choice field type's template, the `_form_is_choice_selected` method
534+
used to identify a selected choice has been replaced with the `selectedchoice`
535+
filter.
538536
539537
Before:
540538
@@ -549,9 +547,9 @@
549547
After:
550548
551549
```
552-
{% for choice in choices %}
553-
<option value="{{ choice.value }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>
554-
{{ choice.label }}
550+
{% for choice, label in choices %}
551+
<option value="{{ choice }}"{% if choice is selectedchoice(form) %} selected="selected"{% endif %}>
552+
{{ label }}
555553
</option>
556554
{% endfor %}
557555
```

0 commit comments

Comments
 (0)
0