Skip to content

Commit

Permalink
Merge pull request #33 from GoteoFoundation/new_home_route
Browse files Browse the repository at this point in the history
add / route without locale and then redirect
  • Loading branch information
davidbeig authored Mar 28, 2023
2 parents 922951c + f6a3ce7 commit 87eadac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Controller/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,19 @@
use App\UseCase\GetUserApiTokenUseCase;
use App\UseCase\GetUserInfoUseCase;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class HomeController extends AbstractController
{

#[Route('/')]
public function indexNoLocale(Request $request): Response
{
return $this->redirectToRoute('home', ['_locale' => $request->getLocale()]);
}

#[Route('/{_locale}', name: 'home')]
public function index(): Response
{
Expand Down

0 comments on commit 87eadac

Please sign in to comment.