File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed
src/Symfony/Component/Routing Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change @@ -630,3 +630,31 @@ HttpFoundation
630
630
` ` ` php
631
631
$request->query->get('foo')[bar];
632
632
` ` `
633
+
634
+ Routing
635
+ -------
636
+
637
+ * Deprecated the hardcoded value for the `$referenceType` argument of the `UrlGeneratorInterface::generate` method.
638
+ Use the constants defined in the `UrlGeneratorInterface` instead.
639
+
640
+ Before :
641
+
642
+ ` ` ` php
643
+ // url generated in controller
644
+ $this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
645
+
646
+ // url generated in @router service
647
+ $router->generate('blog_show', array('slug' => 'my-blog-post'), true);
648
+ ` ` `
649
+
650
+ After :
651
+
652
+ ` ` ` php
653
+ use Symfony\C omponent\R outing\G enerator\UrlGenera torInterface;
654
+
655
+ // url generated in controller
656
+ $this->generateUrl('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
657
+
658
+ // url generated in @router service
659
+ $router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
660
+ ` ` `
Original file line number Diff line number Diff line change @@ -899,6 +899,30 @@ UPGRADE FROM 2.x to 3.0
899
899
* The `getMatcherDumperInstance()` and `getGeneratorDumperInstance()` methods in the
900
900
` Symfony\C omponent\R outing\R outer` have been changed from `public` to `protected`.
901
901
902
+ * Use the constants defined in the UrlGeneratorInterface for the $referenceType argument of the UrlGeneratorInterface::generate method.
903
+
904
+ Before :
905
+
906
+ ` ` ` php
907
+ // url generated in controller
908
+ $this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
909
+
910
+ // url generated in @router service
911
+ $router->generate('blog_show', array('slug' => 'my-blog-post'), true);
912
+ ` ` `
913
+
914
+ After :
915
+
916
+ ` ` ` php
917
+ use Symfony\C omponent\R outing\G enerator\UrlGenera torInterface;
918
+
919
+ // url generated in controller
920
+ $this->generateUrl('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
921
+
922
+ // url generated in @router service
923
+ $router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
924
+ ` ` `
925
+
902
926
# ## Security
903
927
904
928
* The `Resources/` directory was moved to `Core/Resources/`
Original file line number Diff line number Diff line change @@ -7,6 +7,22 @@ CHANGELOG
7
7
* allowed specifying a directory to recursively load all routing configuration files it contains
8
8
* Added ObjectRouteLoader and ServiceRouteLoader that allow routes to be loaded
9
9
by calling a method on an object/service.
10
+ * [ DEPRECATION] Deprecated the hardcoded value for the ` $referenceType ` argument of the ` UrlGeneratorInterface::generate ` method.
11
+ Use the constants defined in the ` UrlGeneratorInterface ` instead.
12
+
13
+ Before:
14
+
15
+ ``` php
16
+ $router->generate('blog_show', array('slug' => 'my-blog-post'), true);
17
+ ```
18
+
19
+ After:
20
+
21
+ ``` php
22
+ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
23
+
24
+ $router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
25
+ ```
10
26
11
27
2.5.0
12
28
-----
You can’t perform that action at this time.
0 commit comments