symfony referer with locale

76 Views Asked by At

i try simply to redirect page last see with argument location (us,fr,es,it,etc...)

it's work perfectly with href=fr, or href=it

but if i'm on login page, that redirect in index...

so i try in controller make that, but not result

 #[Route( '/change_locale/{localisation}', name: 'change_locale', methods: ['GET'])]
    public function changeLocale( string $localisation, Request $request)
{
    // On revient sur la page précédente
    return $this->redirect($request->headers->get('referer'),302,['_locale' => $localisation]);
}

someone can help me?

i try to help me, i have try lot of code

0

There are 0 best solutions below