From 96164f5d2b5003cbd4809d942e51ae34028e6aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20Eugon=C3=A9?= Date: Mon, 5 Feb 2024 11:51:29 +0100 Subject: [PATCH] Fixed documentation around generating absolute URLs with Symfony (#336) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yann Eugoné --- doc/2-configuration.md | 12 ++++++------ src/Command/DumpSitemapsCommand.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/2-configuration.md b/doc/2-configuration.md index 4c1df09..f7cbd91 100644 --- a/doc/2-configuration.md +++ b/doc/2-configuration.md @@ -64,15 +64,15 @@ you have to set the base URL of where you sitemap files will be accessible. The of the URL will also be used to make Router generate URLs with hostname. ```yaml -# config/services.yaml -parameters: - router.request_context.host: your-domain.com - router.request_context.scheme: http +# config/packages/routing.yaml +framework: + router: + default_uri: 'https://your-domain.com' ``` -> **Note:** You may noticed that there is nothing specific to this bundle. +> **Note:** You may have noticed that there is nothing specific to this bundle. > In fact, doing this you just allowed your whole application to generate URLs from the command line. -> Please have a look to Symfony's [official documentation](https://symfony.com/doc/current/console/request_context.html) +> Please have a look to Symfony's [official documentation](https://symfony.com/doc/current/routing.html#generating-urls-in-commands) > for more information. diff --git a/src/Command/DumpSitemapsCommand.php b/src/Command/DumpSitemapsCommand.php index 55268ef..d527e6e 100644 --- a/src/Command/DumpSitemapsCommand.php +++ b/src/Command/DumpSitemapsCommand.php @@ -72,7 +72,7 @@ protected function configure(): void null, InputOption::VALUE_REQUIRED, 'Base url to use for absolute urls. Good example - http://acme.com/, bad example - acme.com.' . - ' Defaults to router.request_context.host parameter' + ' Defaults to Symfony\'s default routing context' ) ->addOption( 'gzip',