8000 added the UPGRADE file for Symfony 3.0 · symfony/symfony@9fc7def · GitHub
[go: up one dir, main page]

Skip to content

Commit 9fc7def

Browse files
committed
added the UPGRADE file for Symfony 3.0
1 parent e84cad2 commit 9fc7def

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

UPGRADE-3.0.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
```

0 commit comments

Comments
 (0)
0