src/Controller/EntrepriseController.php line 29

Open in your IDE?
  1. <?php
  2. // src/Controller/EntrepriseController.php
  3. namespace App\Controller;
  4. use App\Entity\Photo;
  5. use App\Entity\CategoriePhoto;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. /**
  11.  * @Route("/")
  12.  */
  13. class EntrepriseController extends AbstractController
  14. {    
  15.         private $session;
  16.     
  17.     public function __construct(SessionInterface $session)
  18.         {
  19.             $this->session = $session;
  20.         }
  21.         /**
  22.         * @Route("/", name="home_first")
  23.         */
  24.         public function homeFirstAction()
  25.         {
  26.                 $em = $this->getDoctrine()
  27.                     ->getManager();
  28.                  $agency = $em->getRepository(CategoriePhoto::class)
  29.                                 ->findOneByNom('Agency');
  30.                 $evenement = $em->getRepository(CategoriePhoto::class)
  31.                                 ->findOneByNom('Evenement');
  32.                 $formation = $em->getRepository(CategoriePhoto::class)
  33.                                 ->findOneByNom('Formation');
  34.                 /*
  35.                 for($i= 49; $i <= 64; $i++){
  36.                         $photo = new Photo;
  37.                         $photo->setUrl('https://www.shynimpact.com/images/formation/'.$i.'.jpeg');
  38.                         $photo->setCategoriePhoto($formation);
  39.                         $em->persist($photo);
  40.                 }
  41.                 $em->flush();
  42.                 */
  43.                 $mariage = $em->getRepository(CategoriePhoto::class)
  44.                                 ->findOneByNom('Mariage');
  45.                 
  46.         return $this->render('entreprise/accueil.html.twig', [
  47.             
  48.                      
  49.                 ]);
  50.     }
  51.     
  52.     /**
  53.         * @Route("/{_locale}", name="home")
  54.         */
  55.         public function homeAction()
  56.         {
  57.              $em = $this->getDoctrine()
  58.                     ->getManager();
  59.         return $this->render('entreprise/accueil.html.twig', [
  60.             
  61.                       
  62.                 ]);
  63.     }
  64.     
  65.     
  66.     
  67.         /**
  68.         * @Route("/{_locale}/contact", name="contact")
  69.         */
  70.         public function contactAction()
  71.         {
  72.         
  73.             return $this->render('entreprise/contact.html.twig', [
  74.             
  75.                 ]);
  76.     }
  77. }