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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top