Symfony2 user registration form example from official docs
-
02-07-2021 - |
Pregunta
I suppose there is something wrong in this example for a simple user registration form in Symfony2.x. In particular, I suppose that there is no setting of the user data. For instance, the setUser()
function from Registration
class is never used.
Am I right?
If the answer is 'Yes', where should the setUser()
function be called?
If the answer is 'No', so why to define that function?
Solución
Yes, this function is used. It is used by Symfony when it needs to set the $user property of your registration object, for example when the form is bound. You don´t need to "call" it, it will be called by Symfony when needed.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow