The controller for URI is not callable in symfony
The controller for URI is not callable in symfony
This is a very common error for symfony starters, and it happened to me also when I first tried the framework, so you have to follow two steps in order to debug this:
First check
First step is to make sure that your controller is actually a public function rather than protected, because this is very important.
Second check
You defined in the routing.yml file of your bundle the controller’s function name like this:
1 2 3 |
ajax_save_picture: pattern: /save-picture defaults: { _controller: UserBundle:Default:save } |
The logical name UserBundle:Default:save refers to UserBunde\Controller\DefaultController::saveAction, so the function should be called
1 2 3 4 |
public function saveAction() { //your function body here } |
Heads up! Do not forget about the capital “A” from within the function name.