src/Controller/CompetencesController.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\Bibliotheque;
  4. use App\Entity\Cms;
  5. use App\Entity\Framework;
  6. use App\Entity\Langage;
  7. use App\Entity\Outil;
  8. use Doctrine\ORM\EntityManagerInterface;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. use Symfony\Component\HttpFoundation\Response;
  11. use Symfony\Component\Routing\Annotation\Route;
  12. class CompetencesController extends AbstractController
  13. {
  14.     public function __construct(EntityManagerInterface $manager)
  15.     {
  16.         $this->manager $manager;
  17.     }
  18.     /**
  19.      * @Route("/competences", name="app_competences")
  20.      */
  21.     public function allCompetences(): Response
  22.     {
  23.         // Récuperer toutes les types de compétences informatiques dans la BDD
  24.         $langages $this->manager->getRepository(Langage::class)->findAll();
  25.         $cms $this->manager->getRepository(Cms::class)->findAll();
  26.         $bibliotheques $this->manager->getRepository(Bibliotheque::class)->findAll();
  27.         $outils $this->manager->getRepository(Outil::class)->findAll();
  28.         $frameworks $this->manager->getRepository(Framework::class)->findAll();
  29.         // Afficher toutes les compétences sur une seule et même page
  30.         return $this->render('competences/index.html.twig', [
  31.             'langages' => $langages,
  32.             'cms' => $cms,
  33.             'bibliotheques' => $bibliotheques,
  34.             'outils' => $outils,
  35.             'frameworks' => $frameworks,
  36.         ]);
  37.     }
  38.     
  39.     /**
  40.      * @Route("/competencesTab", name="app_competences_tab")
  41.      */
  42.     public function allCompetencesTab(): Response 
  43.     {
  44.         // Récuperer toutes les types de compétences informatiques dans la BDD
  45.         $langages $this->manager->getRepository(Langage::class)->findAll();
  46.         $cms $this->manager->getRepository(Cms::class)->findAll();
  47.         $bibliotheques $this->manager->getRepository(Bibliotheque::class)->findAll();
  48.         $outils $this->manager->getRepository(Outil::class)->findAll();
  49.         $frameworks $this->manager->getRepository(Framework::class)->findAll();
  50.         // Afficher toutes les compétences sur une seule et même page
  51.         return $this->render('competences/indexTabCompose.html.twig', [
  52.             'langages' => $langages,
  53.             'cms' => $cms,
  54.             'bibliotheques' => $bibliotheques,
  55.             'outils' => $outils,
  56.             'frameworks' => $frameworks,
  57.         ]);
  58.     }
  59. }