You cannot set data_class
option `Hoax\PartnerBundle\Entity\VpnUsers' since what you are submitting is not an object.
Either set that to NULL
or create an object from request data and pass it to you form.
In case of NULL
you are very close:
- set
data_class
to null In controller do the following:
$form = $this->createForm(new VpnUsersType(), $request->get('vpnusers'));
In case you go for object type:
- leave
data_class
be In controller:
$req_data = $request->get('vpnusers'); // either fetch from database **or** creare new instance here, your call... $vpnUser = $this->getDoctrine()->getRepository('HoaxPartnerBundle:VpnUsers')->find($req_data['status_id']); // IS THIS OK? Not sure really... $form = $this->createForm(new VpnUsersType(), $vpnUser);