0

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

2
  • And if you try with options: expose: true in your routing file after path ? Commented Sep 16, 2014 at 14:09
  • What's the path to your controller? What's the defined namespace in your controller? Commented Sep 16, 2014 at 14:24

1 Answer 1

1

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');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.