Reputation: 437
In my symfony application I would like to get form model object before calling save method.For example: on form submit I bind it to the related Form Object. And before calling save method I want to get related Model object with its submitted values.I know there is $this->form->getObject()
method.When I call it before $this->form->save();
method it returns model without values. Is there any way to get it? Any help is appreciated.
Thanks in advance!
Upvotes: 3
Views: 1902
Reputation: 34125
The form's values are only set in the object in save(). You have two options:
$form->getValues()
, it returns the cleaned array$form->updateObject()
manually.Upvotes: 4