<?php
namespace App\Controller;
use App\Repository\CookieRepository;
use App\Services\CookieSessionService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class CookieController extends AbstractController
{
/**
* @Route("/cookie", name="app_cookie")
*/
public function affichage(CookieRepository $cookieRepo): Response
{
return $this->render('cookie/affichage.html.twig', [
'cookies' => $cookieRepo->findCookie()
]);
}
/**
* @Route("/accept-cookie", name="app_accept_cookie")
*/
public function acceptCookie(CookieSessionService $cs): Response
{
$cs->remove();
$cs->acceptCookie();
return $this->redirectToRoute('home');
}
}