Skip to content

Commit f0bcff3

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: Rename variable to stay consistent
2 parents 4a27315 + e134083 commit f0bcff3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

routing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,7 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
24152415
class SomeService
24162416
{
24172417
public function __construct(
2418-
private UrlGeneratorInterface $router,
2418+
private UrlGeneratorInterface $urlGenerator,
24192419
) {
24202420
}
24212421

@@ -2424,20 +2424,20 @@ the :class:`Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface` class
24242424
// ...
24252425

24262426
// generate a URL with no route arguments
2427-
$signUpPage = $this->router->generate('sign_up');
2427+
$signUpPage = $this->urlGenerator->generate('sign_up');
24282428

24292429
// generate a URL with route arguments
2430-
$userProfilePage = $this->router->generate('user_profile', [
2430+
$userProfilePage = $this->urlGenerator->generate('user_profile', [
24312431
'username' => $user->getUserIdentifier(),
24322432
]);
24332433

24342434
// generated URLs are "absolute paths" by default. Pass a third optional
24352435
// argument to generate different URLs (e.g. an "absolute URL")
2436-
$signUpPage = $this->router->generate('sign_up', [], UrlGeneratorInterface::ABSOLUTE_URL);
2436+
$signUpPage = $this->urlGenerator->generate('sign_up', [], UrlGeneratorInterface::ABSOLUTE_URL);
24372437

24382438
// when a route is localized, Symfony uses by default the current request locale
24392439
// pass a different '_locale' value if you want to set the locale explicitly
2440-
$signUpPageInDutch = $this->router->generate('sign_up', ['_locale' => 'nl']);
2440+
$signUpPageInDutch = $this->urlGenerator->generate('sign_up', ['_locale' => 'nl']);
24412441
}
24422442
}
24432443

0 commit comments

Comments
 (0)