diff --git a/CHANGELOG-2.1.md b/CHANGELOG-2.1.md index 5dbe07a044..9b7b631444 100644 --- a/CHANGELOG-2.1.md +++ b/CHANGELOG-2.1.md @@ -165,6 +165,14 @@ 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) * added support for empty form name at root level, this enables rendering forms without form name prefix in field names + + * [BC BREAK] made form naming more restrictive. Form and field names must + 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 + from "$$name$$" to "__name__". No dollars are appended/prepended to custom + names anymore. * [BC BREAK] greatly improved `ChoiceListInterface` and all of its implementations. `EntityChoiceList` was adapted, the methods `getEntities()`, diff --git a/UPGRADE-2.1.md b/UPGRADE-2.1.md index 7439f0eb10..9b79eb32ae 100644 --- a/UPGRADE-2.1.md +++ b/UPGRADE-2.1.md @@ -122,3 +122,22 @@ UPGRADE FROM 2.0 to 2.1 {{ choice.label }} {% endfor %} + +* In the template of the collection type, the default name of the prototype + field has changed from "$$name$$" to "__name__" + + For custom names, no dollars are prepended/appended anymore. You are advised + to prepend and append double underscores wherever you have configured the + prototype name manually. + + Before: + + $builder->add('tags', 'collection', array('prototype' => 'proto')); + + // results in the name "$$proto$$" in the template + + After: + + $builder->add('tags', 'collection', array('prototype' => '__proto__')); + + // results in the name "__proto__" in the template