src/Controller/MainController.php line 12

  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\MetaRepository;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. class MainController extends AbstractController
  7. {
  8.     #[Route('/'name'page_home1'requirements: ['_locale' => 'en|ru|hy'], defaults: ['_locale' => 'ru'])]
  9.     public function index1()
  10.     {
  11.         if ($this->getUser()) {
  12.             return $this->redirectToRoute('app_dashboard');
  13.         } else {
  14.             return $this->redirectToRoute('app_login');
  15.         }
  16.     }
  17.     #[Route('/{_locale}'name'page_home'requirements: ['_locale' => 'en|ru|hy'], defaults: ['_locale' => 'ru'])]
  18.     public function index(MetaRepository $metaRepository)
  19.     {
  20.         if ($this->getUser()) {
  21.             return $this->redirectToRoute('app_dashboard');
  22.         } else {
  23.             return $this->redirectToRoute('app_login');
  24.         }
  25.     }
  26. }