@@ -2372,7 +2372,7 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
2372
2372
class SomeService
2373
2373
{
2374
2374
public function __construct(
2375
- private UrlGeneratorInterface $router ,
2375
+ private UrlGeneratorInterface $urlGenerator ,
2376
2376
) {
2377
2377
}
2378
2378
@@ -2381,20 +2381,20 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
2381
2381
// ...
2382
2382
2383
2383
// generate a URL with no route arguments
2384
- $signUpPage = $this->router ->generate('sign_up');
2384
+ $signUpPage = $this->urlGenerator ->generate('sign_up');
2385
2385
2386
2386
// generate a URL with route arguments
2387
- $userProfilePage = $this->router ->generate('user_profile', [
2387
+ $userProfilePage = $this->urlGenerator ->generate('user_profile', [
2388
2388
'username' => $user->getUserIdentifier(),
2389
2389
]);
2390
2390
2391
2391
// generated URLs are "absolute paths" by default. Pass a third optional
2392
2392
// argument to generate different URLs (e.g. an "absolute URL")
2393
- $signUpPage = $this->router ->generate('sign_up', [], UrlGeneratorInterface::ABSOLUTE_URL);
2393
+ $signUpPage = $this->urlGenerator ->generate('sign_up', [], UrlGeneratorInterface::ABSOLUTE_URL);
2394
2394
2395
2395
// when a route is localized, Symfony uses by default the current request locale
2396
2396
// pass a different '_locale' value if you want to set the locale explicitly
2397
- $signUpPageInDutch = $this->router ->generate('sign_up', ['_locale' => 'nl']);
2397
+ $signUpPageInDutch = $this->urlGenerator ->generate('sign_up', ['_locale' => 'nl']);
2398
2398
}
2399
2399
}
2400
2400
0 commit comments