Answer the question
In order to leave comments, you need to log in
Why doesn't $em = $this->getDoctrine()->getManager(); code work?
Ordinary controller (extends from Controller).
throws an error:$em = $this->getDoctrine()->getManager();
Error: Call to a member function get() on a non-object
Answer the question
In order to leave comments, you need to log in
Your Controller doesn't have a Container. Maybe you manually created a controller instance: new MyController() without injecting a Container into it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question