I'm working on Symfony 2.3 and I declared a new route and new controller, but when I call this controller from the browser I get this error:
The controller for URI "/user/1" is not callable. in /dev.mydomain.org/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php at line 82
This is my simple route configuration:
user_homepage: pattern: /user defaults: { _controller: UserBundle:Default:index } user_show: pattern: /user/{id} defaults: { _controller: UserBundle:Default:show } requirements: id: \d+
And this is my very simple controller:
public function showUserAction($id) { return $this->render('UserBundle:Default:show.html.twig', array()); }
What is wrong?
The logical name UserBundle:Default:show
refers to UserBunde\Controller\DefaultController::showAction
you have a method called showUserAction
.
Either change the method name to showAction
or change the logical name to UserBundle:Default:showUser
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With