diff --git a/Controller/DefaultController.php b/Controller/DefaultController.php index 726a0a4e1..52edfa046 100644 --- a/Controller/DefaultController.php +++ b/Controller/DefaultController.php @@ -10,4 +10,9 @@ class DefaultController extends Controller { return $this->render('ChillMainBundle::layout.html.twig'); } -} + + public function indexWithoutLocaleAction() + { + return $this->redirect($this->generateUrl('chill_main_homepage')); + } +} \ No newline at end of file diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index e3b41b410..44755a907 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -4,6 +4,14 @@ root: _controller: FrameworkBundle:Redirect:urlRedirect path: /homepage permanent: true + +chill_main_homepage_without_locale: + pattern: /homepage + defaults: { _controller: ChillMainBundle:Default:indexWithoutLocale } + +chill_main_homepage: + pattern: /{_locale}/homepage + defaults: { _controller: ChillMainBundle:Default:index } options: menus: section: @@ -11,12 +19,8 @@ root: label: Homepage icon: home -cl_chill_main_homepage: - pattern: /homepage - defaults: { _controller: ChillMainBundle:Default:index } - chill_main_admin_central: - pattern: /admin + pattern: /{_locale}/admin defaults: { _controller: ChillMainBundle:Admin:index } options: menus: @@ -39,4 +43,4 @@ logout: user: order: 10 label: Logout - icon: power-off + icon: power-off \ No newline at end of file diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig index 9f8f8a2e3..643262b5c 100644 --- a/Resources/views/layout.html.twig +++ b/Resources/views/layout.html.twig @@ -49,16 +49,21 @@ 'layout': 'ChillMainBundle::Menu/user.html.twig', }) }} + + + {{ app.request.locale }} {% block layout_content %}