<?php
// src/Controller/EntrepriseController.php
namespace App\Controller;
use App\Entity\Photo;
use App\Entity\CategoriePhoto;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
/**
* @Route("/")
*/
class EntrepriseController extends AbstractController
{
private $session;
public function __construct(SessionInterface $session)
{
$this->session = $session;
}
/**
* @Route("/", name="home_first")
*/
public function homeFirstAction()
{
$em = $this->getDoctrine()
->getManager();
$agency = $em->getRepository(CategoriePhoto::class)
->findOneByNom('Agency');
$evenement = $em->getRepository(CategoriePhoto::class)
->findOneByNom('Evenement');
$formation = $em->getRepository(CategoriePhoto::class)
->findOneByNom('Formation');
/*
for($i= 49; $i <= 64; $i++){
$photo = new Photo;
$photo->setUrl('https://www.shynimpact.com/images/formation/'.$i.'.jpeg');
$photo->setCategoriePhoto($formation);
$em->persist($photo);
}
$em->flush();
*/
$mariage = $em->getRepository(CategoriePhoto::class)
->findOneByNom('Mariage');
return $this->render('entreprise/accueil.html.twig', [
]);
}
/**
* @Route("/{_locale}", name="home")
*/
public function homeAction()
{
$em = $this->getDoctrine()
->getManager();
return $this->render('entreprise/accueil.html.twig', [
]);
}
/**
* @Route("/{_locale}/contact", name="contact")
*/
public function contactAction()
{
return $this->render('entreprise/contact.html.twig', [
]);
}
}