Improved choice list sections of UPGRADE and CHANGELOG
This commit is contained in:
parent
a676598d74
commit
d346ae6a8f
@ -166,43 +166,30 @@ To get the diff between two versions, go to https://github.com/symfony/symfony/c
|
|||||||
* allowed setting different options for RepeatedType fields (like the label)
|
* allowed setting different options for RepeatedType fields (like the label)
|
||||||
* added support for empty form name at root level, this enables rendering forms
|
* added support for empty form name at root level, this enables rendering forms
|
||||||
without form name prefix in field names
|
without form name prefix in field names
|
||||||
|
* [BC BREAK] form and field names must start with a letter, digit or underscore
|
||||||
* [BC BREAK] made form naming more restrictive. Form and field names must
|
and only contain letters, digits, underscores, hyphens and colons
|
||||||
start with a letter, digit or underscore and only contain letters, digits,
|
|
||||||
underscores, hyphens and colons
|
|
||||||
|
|
||||||
* [BC BREAK] changed default name of the prototype in the "collection" type
|
* [BC BREAK] changed default name of the prototype in the "collection" type
|
||||||
from "$$name$$" to "__name__". No dollars are appended/prepended to custom
|
from "$$name$$" to "__name__". No dollars are appended/prepended to custom
|
||||||
names anymore.
|
names anymore.
|
||||||
|
* [BC BREAK] improved ChoiceListInterface and all of its implementations
|
||||||
* [BC BREAK] greatly improved `ChoiceListInterface` and all of its
|
* [BC BREAK] removed EntitiesToArrayTransformer and EntityToIdTransformer.
|
||||||
implementations. `EntityChoiceList` was adapted, the methods `getEntities()`,
|
The former has been replaced by CollectionToArrayTransformer in combination
|
||||||
`getEntitiesByKeys()`, `getIdentifier()` and `getIdentifierValues()` were
|
with EntityChoiceList, the latter is not required in the core anymore.
|
||||||
removed/made private. Instead of the first two you can use `getChoices()`
|
|
||||||
and `getChoicesByValues()`, for the latter two no replacement exists.
|
|
||||||
`ArrayChoiceList` was replaced by `SimpleChoiceList`.
|
|
||||||
`PaddedChoiceList`, `MonthChoiceList` and `TimezoneChoiceList` were removed.
|
|
||||||
Their functionality was merged into `DateType`, `TimeType` and `TimezoneType`.
|
|
||||||
|
|
||||||
* [BC BREAK] removed `EntitiesToArrayTransformer` and `EntityToIdTransformer`.
|
|
||||||
The former has been replaced by `CollectionToArrayTransformer` in combination
|
|
||||||
with `EntityChoiceList`, the latter is not required in the core anymore.
|
|
||||||
|
|
||||||
* [BC BREAK] renamed
|
* [BC BREAK] renamed
|
||||||
|
|
||||||
* `ArrayToBooleanChoicesTransformer` to `ChoicesToBooleanArrayTransformer`
|
* ArrayToBooleanChoicesTransformer to ChoicesToBooleanArrayTransformer
|
||||||
* `ScalarToBooleanChoicesTransformer` to `ChoiceToBooleanArrayTransformer`
|
* ScalarToBooleanChoicesTransformer to ChoiceToBooleanArrayTransformer
|
||||||
* `ArrayToChoicesTransformer` to `ChoicesToValuesTransformer`
|
* ArrayToChoicesTransformer to ChoicesToValuesTransformer
|
||||||
* `ScalarToChoiceTransformer` to `ChoiceToValueTransformer`
|
* ScalarToChoiceTransformer to ChoiceToValueTransformer
|
||||||
|
|
||||||
to be consistent with the naming in `ChoiceListInterface`.
|
to be consistent with the naming in ChoiceListInterface.
|
||||||
|
|
||||||
* [BC BREAK] removed `FormUtil::toArrayKey()` and `FormUtil::toArrayKeys()`.
|
* [BC BREAK] removed FormUtil::toArrayKey() and FormUtil::toArrayKeys().
|
||||||
They were merged into `ChoiceList` and have no public equivalent anymore.
|
They were merged into ChoiceList and have no public equivalent anymore.
|
||||||
|
* added ComplexChoiceList and ObjectChoiceList. Both let you select amongst
|
||||||
* added `ComplexChoiceList` and `ObjectChoiceList`. Both let you select amongst
|
|
||||||
objects in a choice field, but feature different constructors.
|
objects in a choice field, but feature different constructors.
|
||||||
* choice fields now throw a `FormException` if neither the "choices" nor the
|
* choice fields now throw a FormException if neither the "choices" nor the
|
||||||
"choice_list" option is set
|
"choice_list" option is set
|
||||||
* the radio field is now a child type of the checkbox field
|
* the radio field is now a child type of the checkbox field
|
||||||
|
|
||||||
|
@ -78,6 +78,23 @@ UPGRADE FROM 2.0 to 2.1
|
|||||||
enable BC behaviour by setting the option "cascade_validation" to `true` on
|
enable BC behaviour by setting the option "cascade_validation" to `true` on
|
||||||
the parent form.
|
the parent form.
|
||||||
|
|
||||||
|
* Changed implementation of choice lists
|
||||||
|
|
||||||
|
ArrayChoiceList was replaced. If you have custom classes that extend
|
||||||
|
ArrayChoiceList and load the choices in the constructor, you can extend
|
||||||
|
SimpleChoiceList instead. If choices are loaded lazily, you should extend
|
||||||
|
LazyChoiceList and implement its `loadChoiceList` method.
|
||||||
|
|
||||||
|
PaddedChoiceList, MonthChoiceList and TimezoneChoiceList were removed.
|
||||||
|
Their functionality was merged into DateType, TimeType and
|
||||||
|
TimezoneType.
|
||||||
|
|
||||||
|
EntityChoiceList was adapted. The methods `getEntities`,
|
||||||
|
`getEntitiesByKeys`, `getIdentifier` and `getIdentifierValues` were
|
||||||
|
removed/made private. Instead of the first two, you can now use
|
||||||
|
`getChoices` and `getChoicesByValues`. For the latter two, no
|
||||||
|
replacement exists.
|
||||||
|
|
||||||
* The strategy for generating the HTML attributes "id" and "name"
|
* The strategy for generating the HTML attributes "id" and "name"
|
||||||
of choices in a choice field has changed
|
of choices in a choice field has changed
|
||||||
|
|
||||||
@ -102,8 +119,8 @@ UPGRADE FROM 2.0 to 2.1
|
|||||||
* In the template of the choice type, the structure of the "choices" variable
|
* In the template of the choice type, the structure of the "choices" variable
|
||||||
has changed
|
has changed
|
||||||
|
|
||||||
"choices" now contains ChoiceView objects with two getters `getValue()`
|
"choices" now contains ChoiceView objects with two getters `getValue`
|
||||||
and `getLabel()` to access the choice data. The indices of the array
|
and `getLabel` to access the choice data. The indices of the array
|
||||||
store an index whose generation is controlled by the "index_generation"
|
store an index whose generation is controlled by the "index_generation"
|
||||||
option of the choice field.
|
option of the choice field.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user