php - Add property to database with the controller -
my application have 2 entity user
, status
, every user can add 0 or many status, use entity
user in status form, when user want add status can add status user choice field. want every status take automatically id user? remove part status form :
>add('patient','entity',array('class'=>'doctorbundle:patient','property'=>'id','multiple'=>false))
and change status controller:
$id= $entity->setmedecin(); $form = $this->createform(new statuttype(), $entity, array( 'action' => $this->generateurl('statut_create'), 'method' => 'post', )); $form->add('submit', 'submit', array('label' => 'ajouter')); return $form; }
Comments
Post a Comment