Answer the question
In order to leave comments, you need to log in
Why do the values in $this->getUser() change after $form->handleRequest($request)??
There was a question, if you create a form for editing a user and edit yourself in this form, then after
$form->handleRequest($request);
dd($this->getUser());
Answer the question
In order to leave comments, you need to log in
Because submit is being executed
1. Submit manually:
Calling Form::submit() manually
2. or use the PRE_SUBMIT event
The FormEvents::PRE_SUBMIT event is dispatched at the beginning of the Form::submit() method.
It can be used to:
- Change data from the request, before submitting the data to the form;
- Add or remove form fields, before submitting the data to the form.
https://symfony.com/doc/3.4/form/events.html#a-the...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question