false to the SonataAdmin form. Now I need to access th...">

Sonata admin, how to read non-displayed field?

I added fields with the option "mapped" => false to the SonataAdmin form.

Now I need to access the values โ€‹โ€‹of the form fields marked "mapped" => false in the postUpdate method. How can I get them?

+8
php forms symfony sonata-admin
source share
1 answer

You can simply get the form and data in your admin class. In the postUpdate method:

 $fieldData = $this->getForm()->get('name_of_field')->getData(); 
+12
source share

All Articles