0

I am learning PHP and Symfony and found a tutorial in youtube from FreeCodeCamp. I followed the program as close as I can but i got the error [Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_PARENTHESIS, got 'delete' at position 28 in method App\Controller\PostController::remove() in /path/config/routes/../../src/Controller/ (which is being imported from "/path/config/routes/annotations.yaml"). Make sure annotations are installed and enabled.

as I am a beginner in symfony and php, i cant diagnose what seems to be the problem. the most i did is follow the code to the letter.

here is the code

 /**
   * @Route("/delete/{id}, name="delete")
   */

  public function remove(Post $post)
  {
    //delete a post
    $em = $this->getDoctrine()->getManager();
    $em->remove($post);
    $em->flush();

    return $this->redirect($this->generateUrl('post.index'));
  }
rod james
  • 369
  • 3
  • 13

0 Answers0