src/Controller/CarrierPostController.php line 33

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\Request;
  6. use Symfony\Component\HttpFoundation\Response;
  7. use Symfony\Component\HttpFoundation\JsonResponse;
  8. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  9. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
  10. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Entity;
  11. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  12. use Symfony\Component\DomCrawler\Crawler;
  13. use Doctrine\ORM\EntityManagerInterface;
  14. use App\Entity\OmeloPage;
  15. use App\Entity\CarrierPost;
  16. class CarrierPostController extends AbstractController
  17. {
  18.     /**
  19.      * @Route(
  20.      *      "/carriere", 
  21.      *      name="carrier", 
  22.      *  )
  23.      * @Template("Omelo/Carrier/archive.html.twig")
  24.      */
  25.     public function carrier(EntityManagerInterface $em){
  26.         $twigData = array();
  27.         $twigData['hideSideMenu'] = true;
  28.         $twigData['forceFooter']=true;
  29.         $twigData['posts'] = $em->getRepository(CarrierPost::class)->getValidPosts();
  30.         return $twigData;
  31.     }
  32.     /**
  33.      * @Route("/carrier/{title}/{id}", 
  34.      *          name="viewCarrierPost",
  35.      *          defaults = {
  36.      *              "title" = false,
  37.      *          },
  38.      *      )
  39.      * @Template("Omelo/Carrier/view.html.twig")
  40.      */
  41.     public function viewCarrierPost(EntityManagerInterface $em$titleCarrierPost $post){
  42.         $twigData = array();
  43.         $twigData['hideSideMenu'] = true;
  44.         $twigData['post'] = $post;
  45.         $twigData['forceFooter']=true;
  46.         return $twigData;
  47.     }
  48. }