G
G
gitdev2021-01-15 22:28:33
symfony
gitdev, 2021-01-15 22:28:33

Symfony Error: Proposition object not found by the @ParamConverter annotation. Is this correct behaviour?

The page should display content by id. If the object is not found in the database - an error will be displayed. Is this the correct behavior when an object with that id is not found? Or should there be another Exception?

/**
     * @Route("/present/{id}", name="cv_present", methods={"GET","POST"}, requirements={"id"="\d+"})
     * @param Proposition $proposition
     * @param Request $request
     * @return Response
     */
    public function present(Proposition $proposition, Request $request): Response
    {
      //этот код не выполняется
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question