File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Filter options
src/Symfony/Component/Routing Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Original file line number Diff line number Diff line change @@ -4,6 +4,49 @@ CHANGELOG
4
4
2.2.0
5
5
-----
6
6
7
+ * [ DEPRECATION] Several route settings have been renamed (the old ones will be removed in 3.0):
8
+
9
+ * The ` pattern ` setting for a route has been deprecated in favor of ` path `
10
+ * The ` _scheme ` and ` _method ` requirements have been moved to the ` schemes ` and ` methods ` settings
11
+
12
+ Before:
13
+
14
+ ```
15
+ article_edit:
16
+ pattern: /article/{id}
17
+ requirements: { '_method': 'POST|PUT', '_scheme': 'https', 'id': '\d+' }
18
+
19
+ <route id="article_edit" pattern="/article/{id}">
20
+ <requirement key="_method">POST|PUT</requirement>
21
+ <requirement key="_scheme">https</requirement>
22
+ <requirement key="id">\d+</requirement>
23
+ </route>
24
+
25
+ $route = new Route();
26
+ $route->setPattern('/article/{id}');
27
+ $route->setRequirement('_method', 'POST|PUT');
28
+ $route->setRequirement('_scheme', 'https');
29
+ ```
30
+
31
+ After:
32
+
33
+ ```
34
+ article_edit:
35
+ path: /article/{id}
36
+ methods: [POST, PUT]
37
+ schemes: https
38
+ requirements: { 'id': '\d+' }
39
+
40
+ <route id="article_edit" pattern="/article/{id}" methods="POST PUT" schemes="https">
41
+ <requirement key="id">\d+</requirement>
42
+ </route>
43
+
44
+ $route = new Route();
45
+ $route->setPath('/article/{id}');
46
+ $route->setMethods(array('POST', 'PUT'));
47
+ $route->setSchemes('https');
48
+ ```
49
+
7
50
* [ BC BREAK] RouteCollection does not behave like a tree structure anymore but as
8
51
a flat array of Routes. So when using PHP to build the RouteCollection, you must
9
52
make sure to add routes to the sub-collection before adding it to the parent
You can’t perform that action at this time.
0 commit comments