Deprecated : Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 58
Deprecated : Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler
<?php
namespace App\Controller ;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController ;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface ;
use Symfony\Component\HttpFoundation\Request ;
use Symfony\Component\HttpFoundation\Response ;
use Symfony\Component\Routing\Annotation\Route ;
class HomeController extends AbstractController
{
#[Route ( path : '/' , name : 'app_home' )]
#[Route ( path : '/{_locale}/' , name : 'app_localized_home' )]
public function index ( Request $request , ParameterBagInterface $parameterBag ): Response
{
$locale = $request -> getLocale () ?? ( $_COOKIE [ '_locale' ]);
return $this -> redirectToRoute ( 'app_login' , [
'_locale' => in_array ( strtolower ( $locale ), explode ( '|' , $parameterBag -> get ( 'app.supported_locales' ))) ? $locale : $parameterBag -> get ( 'app.default_locale' )
]);
}
#[Route ( path : '/connexion' , name : 'app_old_login_redirect' ,)]
public function oldLoginRedirect (): Response
{
return $this -> redirectToRoute ( 'app_home' );
}
}