src/Controller/FrontendController.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\Routing\Annotation\Route;
  5. use Symfony\Component\HttpFoundation\Response;
  6. class FrontendController extends AbstractController
  7. {
  8.     /**
  9.      * @Route("/", name="homepage")
  10.      */
  11.     public function index()
  12.     {
  13.         $em $this->getDoctrine()->getManager();
  14.         $articles $em->getRepository('App:MzkgActualite')->findBy([],['id'=>'DESC'],3);
  15.         return $this->render('frontend/index.html.twig',['articles'=>$articles]);
  16.     }
  17.     /**
  18.      * @Route("/historique", name="historique")
  19.      */
  20.     public function historique()
  21.     {
  22.         return $this->render('frontend/historique.html.twig',[]);
  23.     }
  24.     /**
  25.      * @Route("/gouvernance", name="gouvernance")
  26.      */
  27.     public function gouvernance()
  28.     {
  29.         return $this->render('frontend/gouvernance.html.twig',[]);
  30.     }
  31.     /**
  32.      * @Route("/adn", name="adn")
  33.      */
  34.     public function adn()
  35.     {
  36.         return $this->render('frontend/adn.html.twig',[]);
  37.     }
  38.     /**
  39.      * @Route("/nosmetiers", name="nos-metiers")
  40.      */
  41.     public function nosmetiers()
  42.     {
  43.         $em $this->getDoctrine()->getManager();
  44.         return $this->render('frontend/nosmetiers.html.twig',[]);
  45.     }
  46.     /**
  47.      * @Route("/associations", name="associations")
  48.      */
  49.     public function associations()
  50.     {
  51.         return $this->render('frontend/associations.html.twig');
  52.     }
  53.     /**
  54.      * @Route("/representation", name="representation")
  55.      */
  56.     public function representation()
  57.     {
  58.         return $this->render('frontend/representation.html.twig');
  59.     }
  60.     /**
  61.      * @Route("/contact", name="contact")
  62.      */
  63.     public function contact()
  64.     {
  65.         return $this->render('frontend/contact.html.twig',['evenement'=>'contact']);
  66.     }
  67.     /**
  68.      * @Route("/actualites", name="actualites")
  69.      */
  70.     public function actualites()
  71.     {
  72.         $em $this->getDoctrine()->getManager();
  73.         $articles $em->getRepository('App:MzkgActualite')->findBy([],['id'=>'DESC']);
  74.         return $this->render('frontend/actualites.html.twig',['articles'=>$articles]);
  75.     }
  76.     /**
  77.      * @Route("/article/{slug}", name="article")
  78.      */
  79.     public function article($slug)
  80.     {
  81.         $em $this->getDoctrine()->getManager();
  82.         $article $em->getRepository('App:MzkgActualite')->findOneBy(['slug'=>$slug],['id'=>'DESC']);
  83.         $articles $em->getRepository('App:MzkgActualite')->findBy([],['id'=>'DESC'],3);
  84.         return $this->render('frontend/article.html.twig',['article'=>$article,'articles'=>$articles]);
  85.     }
  86. }