<?php
namespace App\Controller\Front;
use App\Entity\Pack;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
class PackController extends AbstractController
{
/**
* @Route("/pack/{slug}", name="front_pack_single")
*/
public function single(Pack $pack)
{
return $this->render('front/pack/single.html.twig', [
'pack' => $pack
]);
}
/**
* @Route("/mon-panier/suppression-pack/{id}", name="front_my_basket_remove_pack")
*/
public function removeProductToBasket(Pack $pack, SessionInterface $session)
{
$pack = $session->get('packs');
$session->remove('packs');
return $this->redirectToRoute('front_my_basket');
}
}