Question

I just read the documentation of FOSUserBundle and when I was just copying codes from the ducumentation. And when I went to some page, it gave me an error page like this:

ContextErrorException: Runtime Notice: Declaration of Neejob\CompanyBundle\Controller\RegistrationController::registerAction() should be compatible with FOS\UserBundle\Controller\RegistrationController::registerAction(Symfony\Component\HttpFoundation\Request $request) in D:\xampp\htdocs\Symfony\src\Neejob\CompanyBundle\Controller\RegistrationController.php line 9

however, when i refresh the page, it turned out to work fine. But As I clear the cache, the same problem occurs. How should I handle this problem?

Was it helpful?

Solution

The error says that you have to check declaration of registerAction method and change it exactly like in parent class.

Replace:

public function registerAction()

With:

public function registerAction(Request $request)

And don't forget to add use statement

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top