src/Controller/HomeController.php line 73

  1. <?php
  2. namespace App\Controller;
  3. use App\Repository\OfferRepository;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\RequestStack;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class HomeController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/", name="index")
  11.      */
  12.     public function index()
  13.     {
  14.         return $this->render('front/home.html.twig');
  15.     }
  16.     public function displayPromoSlider(OfferRepository $offerRepository)
  17.     {
  18.         $offers $offerRepository->findActivesOffers();
  19.         return $this->render('front/elements/displayPromoSlider.html.twig', [
  20.             'offers' => $offers,
  21.         ]);
  22.     }
  23.     /**
  24.      * @Route("/c/{creator_slug}", name="creators")
  25.      */
  26.     public function creators(RequestStack $requestStack$creator_slug)
  27.     {
  28.         $creator_slug strtolower($creator_slug);
  29.         $creators = ['guiruch''jesusance''theicollection''adelain''alexvizeo''zangarelli''steven''jonat''amoureuxdumonde''couchoud''simon''damien''buddy'];
  30.         if (in_array($creator_slug$creators)) {
  31.             $session $requestStack->getSession();
  32.             $session->set('creator'$creator_slug);
  33.         }
  34.         return $this->redirectToRoute('index');
  35.     }
  36.     /**
  37.      * @Route("/mentions-legales", name="mentions")
  38.      */
  39.     public function mentions()
  40.     {
  41.         return $this->render('front/mentions.html.twig');
  42.     }
  43.     /**
  44.      * @Route("/cgu", name="cgu")
  45.      */
  46.     public function cgu()
  47.     {
  48.         return $this->render('front/cgu.html.twig');
  49.     }
  50.     /**
  51.      * @Route("/faq", name="faq")
  52.      */
  53.     public function faq()
  54.     {
  55.         return $this->render('front/faq.html.twig');
  56.     }
  57.     /**
  58.      * @Route("/comment-ca-marche", name="howItWorks")
  59.      */
  60.     public function howItWorks()
  61.     {
  62.         return $this->render('front/howItWorks.html.twig');
  63.     }
  64. }