ghost
1 year ago
5 changed files with 59 additions and 48 deletions
@ -1,43 +0,0 @@
@@ -1,43 +0,0 @@
|
||||
<?php |
||||
|
||||
namespace App\Controller; |
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
||||
use Symfony\Component\Routing\Annotation\Route; |
||||
use Symfony\Component\HttpFoundation\Response; |
||||
use Symfony\Component\HttpFoundation\Request; |
||||
|
||||
use App\Service\UserService; |
||||
|
||||
class DashboardController extends AbstractController |
||||
{ |
||||
#[Route('/')] |
||||
public function root( |
||||
Request $request, |
||||
UserService $userService |
||||
): Response |
||||
{ |
||||
// Init user |
||||
$user = $userService->init( |
||||
$request->getClientIp() |
||||
); |
||||
|
||||
return $this->redirectToRoute( |
||||
'dashboard_index', |
||||
[ |
||||
'_locale' => $user->getLocale() |
||||
] |
||||
); |
||||
} |
||||
|
||||
#[Route( |
||||
'/{_locale}', |
||||
name: 'dashboard_index' |
||||
)] |
||||
public function index(Request $request): Response |
||||
{ |
||||
return $this->render( |
||||
'default/dashboard/index.html.twig' |
||||
); |
||||
} |
||||
} |
@ -1,2 +0,0 @@
@@ -1,2 +0,0 @@
|
||||
{% extends 'default/layout.html.twig' %} |
||||
{% block title %}{{ 'Home'|trans }} - {{ name }}{% endblock %} |
Loading…
Reference in new issue