traductions, sentry, form, mariadb, assets
Some checks failed
Cadoles/hydra-sql/pipeline/pr-develop There was a failure building this commit
Some checks failed
Cadoles/hydra-sql/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
20
src/Controller/LocaleController.php
Normal file
20
src/Controller/LocaleController.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class LocaleController extends AbstractController
|
||||
{
|
||||
#[Route(path: 'locale/{locale}', name: 'locale_change')]
|
||||
public function changeLocal(string $locale, Request $request)
|
||||
{
|
||||
// On stocke la langue dans la session
|
||||
$request->getSession()->set('_locale', $locale);
|
||||
|
||||
// redirection
|
||||
return $this->redirect($request->headers->get('referer'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user