user1483208
user1483208

Reputation: 385

Symfony2 Controller is not callable

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

Answers (1)

Facundo Fasciolo
Facundo Fasciolo

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

Related Questions