Mention generating absolute urls in UPGRADE files and CHANGELOG

This commit is contained in:
Zdeněk Drahoš 2016-06-17 10:10:27 +02:00 committed by Fabien Potencier
parent f8937bd8b8
commit 5f506d96ff
3 changed files with 68 additions and 0 deletions

View File

@ -630,3 +630,31 @@ HttpFoundation
```php
$request->query->get('foo')[bar];
```
Routing
-------
* Deprecated the hardcoded value for the `$referenceType` argument of the `UrlGeneratorInterface::generate` method.
Use the constants defined in the `UrlGeneratorInterface` instead.
Before:
```php
// url generated in controller
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
// url generated in @router service
$router->generate('blog_show', array('slug' => 'my-blog-post'), true);
```
After:
```php
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
// url generated in controller
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
// url generated in @router service
$router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
```

View File

@ -899,6 +899,30 @@ UPGRADE FROM 2.x to 3.0
* The `getMatcherDumperInstance()` and `getGeneratorDumperInstance()` methods in the
`Symfony\Component\Routing\Router` have been changed from `public` to `protected`.
* Use the constants defined in the UrlGeneratorInterface for the $referenceType argument of the UrlGeneratorInterface::generate method.
Before:
```php
// url generated in controller
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
// url generated in @router service
$router->generate('blog_show', array('slug' => 'my-blog-post'), true);
```
After:
```php
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
// url generated in controller
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
// url generated in @router service
$router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
```
### Security
* The `Resources/` directory was moved to `Core/Resources/`

View File

@ -7,6 +7,22 @@ CHANGELOG
* allowed specifying a directory to recursively load all routing configuration files it contains
* Added ObjectRouteLoader and ServiceRouteLoader that allow routes to be loaded
by calling a method on an object/service.
* [DEPRECATION] Deprecated the hardcoded value for the `$referenceType` argument of the `UrlGeneratorInterface::generate` method.
Use the constants defined in the `UrlGeneratorInterface` instead.
Before:
```php
$router->generate('blog_show', array('slug' => 'my-blog-post'), true);
```
After:
```php
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
$router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
```
2.5.0
-----