src/Controller/DefaultController.php line 40

  1. <?php
  2. namespace App\Controller;
  3. use App\Service\AssociationHandlerService;
  4. use App\Service\TaggedTypesService;
  5. use App\Traits\Form\DiscriminatorFormGenerator;
  6. use Psr\Cache\InvalidArgumentException;
  7. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  8. use Symfony\Bundle\SecurityBundle\Security;
  9. use Symfony\Component\HttpFoundation\RedirectResponse;
  10. use Symfony\Component\HttpFoundation\Request;
  11. use Symfony\Component\HttpFoundation\Response;
  12. use Symfony\Component\Routing\Annotation\Route;
  13. use Symfony\Contracts\Cache\CacheInterface;
  14. /**
  15.  * Tag controller.
  16.  *
  17.  */
  18. #[
  19.     Route('/')
  20. ]
  21. class DefaultController extends AbstractController
  22. {
  23.     use DiscriminatorFormGenerator;
  24.     /**
  25.      * Default
  26.      *
  27.      * @return Response
  28.      *
  29.      */
  30.     #[
  31.         Route('/',
  32.             name'home',
  33.             methods: ['GET']
  34.         )
  35.     ]
  36.     public function home(): Response
  37.     {
  38.         return $this->render('home.html.twig');
  39.     }
  40.     /**
  41.      * Default
  42.      *
  43.      * @return Response
  44.      *
  45.      */
  46.     #[
  47.         Route('/questionsandanswers',
  48.             name'questionsandanswers',
  49.             methods: ['GET']
  50.         )
  51.     ]
  52.     public function questionsandanswers(): Response
  53.     {
  54.         return $this->render('qa.html.twig');
  55.     }
  56.     /**
  57.      * Default
  58.      *
  59.      * @return RedirectResponse
  60.      *
  61.      */
  62.     #[
  63.         Route('/dashboard',
  64.             name'dashboard',
  65.             methods: ['GET']
  66.         )
  67.     ]
  68.     public function dashboard(Security $security): Response
  69.     {
  70.         return $this->redirectToRoute('profile_' get_class($security->getUser())::ENTITY_PATH_IDENTIFIER '_edit');
  71.     }
  72. }