Comments (2)
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
- all forms used by the dot-user package trigger init events you can listen and further customize them. This helps to adapt the forms to match your user data structures. You can also customize the forms by registering delegator factories for them(see zend-servicemanager documentation)
- if you need to take custom actions pre/post some user action, you can hook into the triggered events(triggered by the UserService). See
user_event_listeners
module config key. - for maximum flexibility, you could overwrite UserService methods, but keep in mind you should trigger the events by yourself. I would not recommend this solution without understanding how the dot-user module works.
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.
from frontend.
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
from frontend.
Related Issues (20)
- twig code style ? HOT 6
- inject at composer install ? HOT 5
- Remove unnecessary `HasLifecycleCallbacks` entity attributes
- webpack modules and fonts issues HOT 1
- replace annotated with attributes HOT 2
- ORM 3 HOT 1
- refactyor handler HOT 1
- update js libraries
- remove Translation feature HOT 2
- update logo HOT 2
- Remove `dot-debugbar` integration
- cehck text on index page for outdated infos HOT 1
- Unable to delete my user account
- JS error on pages where `.kv-fileinput-caption` does not exist
- composer.json review HOT 2
- require `dotkernel/dot-session: ^5.5.2`
- add canonical HOT 6
- multilanguage feature
- implement canonical url on dotkernel.org HOT 1
- upgrade dotkernel.org to version 5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frontend.