-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dot\Frontend\User\Controller\UserController doesn't overwrite Dot\User\Controller\UserController #2
Comments
Hi, I'll check into this, but it would be helpful to include the steps you have taken to overwrite the UserController and the error you get. There are a lot of reasons why it could fail. As a side note, I'll publish in the future the best ways you can overwrite the UserController. Usually, it will be enough to overwrite UserService or hook into the RegisterEvent::EVENT_REGISTER_PRE event. The UserController registerAction does nothing more that getting data from POST and validating it with the RegisterForm, than calling the UserService's register method. Given that you can hook into the RegisterForm events, to change form Elements(there is already an example in dot-frontend), or create a delegator factory to further change the RegisterForm creation process, this should be enough to customize the data you send and validate through POST to match you user data structure. To customize the entire registration process, you can overwrite UserService register method instead, as we don't keep business logic into the controller. Extending the UserController should be the last thing to consider, but it could be possible. To summarize
Indeed, this is not very well documented yet, but we'll try to make sure that no matter what method you decide to follow, it won't be a pain. |
I'll close this, as the frontend was completely updated, the user module and the mapper module were redesigned from ground-up. As means of extending the user module, I'm pretty certain that user controller can be overwritten and replaced in the routes config, or additional user controllers can be added to the same route key, user service can be overwritten, or the new event system can be used to hook into user events, for additional logic |
I'm having some issues with the UserController from the main
src/
folderIt seems that the UserController from
src/Frontend/User/Controller/UserController.php
can't overwrite the UserController fromvendor/dotkernel/dot-user/src/Controller/UserController.php
The text was updated successfully, but these errors were encountered: