src/Controller/Front/Modules/SlideshowController.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front\Modules;
  3. use Symfony\Component\HttpFoundation\Request;
  4. use App\Entity\Category;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. use Symfony\Component\HttpFoundation\JsonResponse;
  8. use Doctrine\ORM\EntityManagerInterface;
  9. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  10. use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
  11. class SlideshowController extends \App\Controller\Front\FrontController
  12. {
  13. public function module($id, $locale='fr', EntityManagerInterface $em)
  14. {
  15. $module = $em->getRepository('App:ModuleCarousel')->find($id);
  16. if(empty($module)){
  17. throw new NotFoundHttpException();
  18. }
  19. return $this->render('front/modules/slideshow/module.html.twig', [
  20. 'module' => $module,
  21. 'locale' => $locale
  22. ]);
  23. }
  24. }