From 4f7464a891780919a300ceadc099c84082e64e92 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Tue, 28 Mar 2017 00:44:43 +0100 Subject: [PATCH 1/2] Update routing.rst --- components/routing.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/routing.rst b/components/routing.rst index f6af13d1fac..b30550fb79b 100644 --- a/components/routing.rst +++ b/components/routing.rst @@ -194,6 +194,7 @@ Normally you can pass the values from the ``$_SERVER`` variable to populate the :class:`Symfony\\Component\\Routing\\RequestContext` in a shortcut:: use Symfony\Component\HttpFoundation\Request; + use Symfony\Component\Routing\RequestContext; $context = new RequestContext(); $context->fromRequest(Request::createFromGlobals()); @@ -206,6 +207,9 @@ to find a route that fits the given request you can also build a URL from a certain route:: use Symfony\Component\Routing\Generator\UrlGenerator; + use Symfony\Component\Routing\RouteCollection; + use Symfony\Component\Routing\RequestContext; + use Symfony\Component\Routing\Route; $routes = new RouteCollection(); $routes->add('show_post', new Route('/show/{slug}')); @@ -292,6 +296,7 @@ There is also the :class:`Symfony\\Component\\Routing\\Loader\\ClosureLoader`, w calls a closure and uses the result as a :class:`Symfony\\Component\\Routing\\RouteCollection`:: use Symfony\Component\Routing\Loader\ClosureLoader; + use Symfony\Component\Routing\RouteCollection; $closure = function () { return new RouteCollection(); From 1eaf5d5b7bf64f7fe4b40bf63eaf0f69c482b048 Mon Sep 17 00:00:00 2001 From: Ahmed TAILOULOUTE Date: Tue, 28 Mar 2017 01:06:28 +0100 Subject: [PATCH 2/2] Update routing.rst --- components/routing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/routing.rst b/components/routing.rst index b30550fb79b..3f78392ee30 100644 --- a/components/routing.rst +++ b/components/routing.rst @@ -207,9 +207,9 @@ to find a route that fits the given request you can also build a URL from a certain route:: use Symfony\Component\Routing\Generator\UrlGenerator; - use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\Route; + use Symfony\Component\Routing\RouteCollection; $routes = new RouteCollection(); $routes->add('show_post', new Route('/show/{slug}'));