Bonjour j'etait entrain de faire mon panier sur symfony
voici mon controller "cartController "
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class CartController extends AbstractController
{
/**
* @Route("/SHOP/cart", name="panier_index")
*/
public function index(): Response
{
return $this->render('cart/index.html.twig', []);
}
/**
*
* @Route("/SHOP/panier/add/{id}", name="cart_add)
*/
public function add($id, Request $request)
{
$session = $request->getSession();
$panier = $session->get('panier', []);
$panier[$id] = 1;
$session->set('panier', $panier);
dd($session->get('panier'));
}
}
VOILA l'erreur que j'ai eu :
[Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_PARENTHESIS, got 'cart_add' at position 38 in method App\Controller\CartController::add() in C:\Users\invit\MonProjetVR\config/routes../../src/Controller/ (which is being imported from "C:\Users\invit\MonProjetVR\config/routes/annotations.yaml"). Make sure to use PHP 8+ or that annotations are installed and enabled.
est ce que quelqun peut m'aider
Je crois qu'il faut upgrade php mais jsuis pas sure
MERCI