src/Controller/Front/PackController.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Front;
  3. use App\Entity\Pack;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. class PackController extends AbstractController
  8. {
  9.     /**
  10.      * @Route("/pack/{slug}", name="front_pack_single")
  11.      */
  12.     public function single(Pack $pack)
  13.     {
  14.         return $this->render('front/pack/single.html.twig', [
  15.             'pack' => $pack
  16.         ]);
  17.     }
  18.     /**
  19.      * @Route("/mon-panier/suppression-pack/{id}", name="front_my_basket_remove_pack")
  20.      */
  21.     public function removeProductToBasket(Pack $packSessionInterface $session)
  22.     {
  23.         $pack $session->get('packs');
  24.         $session->remove('packs');
  25.         return $this->redirectToRoute('front_my_basket');
  26.     }
  27. }