diff --git a/config/routes.yaml b/config/routes.yaml index 095ef7c0..951fc109 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -103,8 +103,8 @@ pages_play_online: requirements: _locale: en|es|fr options: - sitemap: true - _locale: en|es|fr + sitemap: + _locale: en|es|fr pages_players: path: /{_locale}/players @@ -134,8 +134,8 @@ pages_about: requirements: _locale: en|es|fr options: - sitemap: true - _locale: en + sitemap: + _locale: en pages_legal: path: /{_locale}/legal diff --git a/src/Controller/SitemapController.php b/src/Controller/SitemapController.php index 011c949f..eab88422 100644 --- a/src/Controller/SitemapController.php +++ b/src/Controller/SitemapController.php @@ -15,8 +15,8 @@ public function index(): Response $routes = Yaml::parseFile("../config/routes.yaml"); foreach ($routes as $key => $val) { if (isset($val['requirements'])) { - if (isset($val['options']['sitemap']) && $val['options']['sitemap']) { - $locale = explode('|', $val['options']['_locale']); + if (isset($val['options']['sitemap'])) { + $locale = explode('|', $val['options']['sitemap']['_locale']); foreach ($locale as $item) { $urls[] = [ 'loc' => $this->generateUrl($key, ['_locale' => $item], UrlGeneratorInterface::ABSOLUTE_URL),