Reputation: 385
I've got this error:
Controller "Superplanner\UserBundle\Controller\RestController::afterResetAction" for URI "/afterreset" is not callable.
routing:
after_reset:
defaults: { _controller: "UserBundle:Rest:afterReset" }
path : /afterreset
security:
- { path: ^/afterreset, role: IS_AUTHENTICATED_ANONYMOUSLY }
method from RestController.php (from my UserBundle):
public function afterResetAction(Request $request)
{
return new JsonResponse(array('Success' => 200, 'Response' => 'ok'), 200);
}
What is wrong with that?!
P.S. Yes, I've cleared cache
Upvotes: 0
Views: 1097
Reputation: 492
Did you try, using the method without that Request parameter?
public function afterResetAction()
{
return new JsonResponse(array('Success' => 200, 'Response' => 'ok'), 200);
}
If you want to get the request from inside the controller, you can do this:
$request = $this->get('request');
Upvotes: 1