File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ UPGRADE FROM 2.x to 3.0
2
+ =======================
3
+
4
+ ### Routing
5
+
6
+ * Some route settings have been renamed:
7
+
8
+ * The ` pattern ` setting for a route has been deprecated in favor of ` path `
9
+ * The ` _scheme ` and ` _method ` requirements have been moved to the ` schemes ` and ` methods ` settings
10
+
11
+ Before:
12
+
13
+ ```
14
+ article_edit:
15
+ pattern: /article/{id}
16
+ requirements: { '_method': 'POST|PUT', '_scheme': 'https', 'id': '\d+' }
17
+
18
+ <route id="article_edit" pattern="/article/{id}">
19
+ <requirement key="_method">POST|PUT</requirement>
20
+ <requirement key="_scheme">https</requirement>
21
+ <requirement key="id">\d+</requirement>
22
+ </route>
23
+
24
+ $route = new Route();
25
+ $route->setPattern('/article/{id}');
26
+ $route->setRequirement('_method', 'POST|PUT');
27
+ $route->setRequirement('_scheme', 'https');
28
+ ```
29
+
30
+ After:
31
+
32
+ ```
33
+ article_edit:
34
+ path: /article/{id}
35
+ methods: [POST, PUT]
36
+ schemes: https
37
+ requirements: { 'id': '\d+' }
38
+
39
+ <route id="article_edit" pattern="/article/{id}" methods="POST PUT" schemes="https">
40
+ <requirement key="id">\d+</requirement>
41
+ </route>
42
+
43
+ $route = new Route();
44
+ $route->setPath('/article/{id}');
45
+ $route->setMethods(array('POST', 'PUT'));
46
+ $route->setSchemes('https');
47
+ ```
You can’t perform that action at this time.
0 commit comments