src/Controller/DashboardController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use App\Repository\SiteRepository;
  7. use App\Repository\RedirectRuleRepository;
  8. class DashboardController extends AbstractController
  9. {
  10.     public function __construct(
  11.         private SiteRepository $siteRepository,
  12.         private RedirectRuleRepository $ruleRepository,
  13.     ) {
  14.     }
  15.     #[Route('/'name'home')]
  16.     public function home(): Response
  17.     {
  18.         // home is just going to forward to dashboard, this is not a "public facing" website
  19.         return $this->redirectToRoute('dashboard');
  20.     }
  21.     #[Route('/dashboard'name'dashboard')]
  22.     public function index(): Response
  23.     {
  24.         return $this->render('dashboard/index.html.twig', [
  25.             'sites' => $this->siteRepository->findAllowedSites($this->getUser())
  26.         ]);
  27.     }
  28. }