@@ -4,6 +4,39 @@ CHANGELOG
4
4
2.2.0
5
5
-----
6
6
7
+ * [ BC BREAK] RouteCollection does not behave like a tree structure anymore but as
8
+ a flat array of Routes. So when using PHP to build the RouteCollection, you must
9
+ make sure to add routes to the sub-collection before adding it to the parent
10
+ collection (this is not relevant when using YAML or XML for Route definitions).
11
+
12
+ Before:
13
+
14
+ ```
15
+ $rootCollection = new RouteCollection();
16
+ $subCollection = new RouteCollection();
17
+ $rootCollection->addCollection($subCollection);
18
+ $subCollection->add('foo', new Route('/foo'));
19
+ ```
20
+
21
+ After:
22
+
23
+ ```
24
+ $rootCollection = new RouteCollection();
25
+ $subCollection = new RouteCollection();
26
+ $subCollection->add('foo', new Route('/foo'));
27
+ $rootCollection->addCollection($subCollection);
28
+ ```
29
+
30
+ Also one must call ` addCollection ` from the bottom to the top hierarchy.
31
+ So the correct sequence is the following (and not the reverse):
32
+
33
+ ```
34
+ $childCollection->->addCollection($grandchildCollection);
35
+ $rootCollection->addCollection($childCollection);
36
+ ```
37
+
38
+ * The methods ` RouteCollection::getParent() ` and ` RouteCollection::getRoot() `
39
+ have been deprecated and will be removed in Symfony 2.3.
7
40
* added support for the method default argument values when defining a @Route
8
41
* Adjacent placeholders without separator work now, e.g. ` /{x}{y}{z}.{_format} ` .
9
42
* Characters that function as separator between placeholders are now whitelisted
0 commit comments