Skip to content

Commit dadefb6

Browse files
author
Marcin Sekalski
committed
Od not use dynamic REQUEST_URI from $_SERVER as base url
1 parent 79775ae commit dadefb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/routing/introduction.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ your autoloader to load the Routing component::
3939
$routes = new RouteCollection();
4040
$routes->add('route_name', $route);
4141

42-
$context = new RequestContext($_SERVER['REQUEST_URI']);
42+
$context = new RequestContext('/');
4343

4444
$matcher = new UrlMatcher($routes, $context);
4545

@@ -207,7 +207,7 @@ a certain route::
207207
$routes = new RouteCollection();
208208
$routes->add('show_post', new Route('/show/{slug}'));
209209

210-
$context = new RequestContext($_SERVER['REQUEST_URI']);
210+
$context = new RequestContext('/');
211211

212212
$generator = new UrlGenerator($routes, $context);
213213

@@ -327,7 +327,7 @@ automatically in the background if you want to use it. A basic example of the
327327
:class:`Symfony\\Component\\Routing\\Router` class would look like::
328328

329329
$locator = new FileLocator(array(__DIR__));
330-
$requestContext = new RequestContext($_SERVER['REQUEST_URI']);
330+
$requestContext = new RequestContext('/');
331331

332332
$router = new Router(
333333
new YamlFileLoader($locator),

0 commit comments

Comments
 (0)