diff --git a/config/webspaces/example.xml b/config/webspaces/example.xml index 6c48607..a7e4987 100644 --- a/config/webspaces/example.xml +++ b/config/webspaces/example.xml @@ -10,6 +10,8 @@ + + @@ -48,22 +50,22 @@ - {host} + {host}/{localization} - {host} + {host}/{localization} - {host} + {host}/{localization} - {host} + {host}/{localization} diff --git a/src/Controller/Website/EventWebsiteController.php b/src/Controller/Website/EventWebsiteController.php index ae12850..643730b 100644 --- a/src/Controller/Website/EventWebsiteController.php +++ b/src/Controller/Website/EventWebsiteController.php @@ -21,7 +21,7 @@ public function __construct( ) { } - #[Route('/event/{id}', name: 'app.event')] + #[Route('/{_locale}/event/{id}', name: 'app.event')] public function indexAction(int $id, Request $request): Response { $event = $this->eventRepository->findById($id, $request->getLocale()); diff --git a/templates/base.html.twig b/templates/base.html.twig index d42fec6..10b987a 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -41,6 +41,12 @@ {% endfor %} + + diff --git a/tests/Functional/Controller/Website/EventWebsiteControllerTest.php b/tests/Functional/Controller/Website/EventWebsiteControllerTest.php index 4b61238..1384c27 100644 --- a/tests/Functional/Controller/Website/EventWebsiteControllerTest.php +++ b/tests/Functional/Controller/Website/EventWebsiteControllerTest.php @@ -26,7 +26,7 @@ public function testIndexAction(): void { $event = $this->createEvent('Sulu is awesome', 'en'); - $crawler = $this->client->request('GET', '/event/' . $event->getId()); + $crawler = $this->client->request('GET', '/en/event/' . $event->getId()); $response = $this->client->getResponse(); $this->assertInstanceOf(Response::class, $response); diff --git a/tests/Functional/Pages/HomepageTest.php b/tests/Functional/Pages/HomepageTest.php index aa55911..d7afaf6 100644 --- a/tests/Functional/Pages/HomepageTest.php +++ b/tests/Functional/Pages/HomepageTest.php @@ -47,7 +47,7 @@ public function testHomepage(): void ], ); - $crawler = $this->client->request(Request::METHOD_GET, '/homepage'); + $crawler = $this->client->request(Request::METHOD_GET, '/en/homepage'); $response = $this->client->getResponse(); $this->assertInstanceOf(Response::class, $response);