だから私はこの複数のフォーム - symfonyの2
$task1 = new Task();
$form1 = $this->createForm(new MyForm(), $task1);
$task2 = new Task();
$form2 = $this->createForm(new MyForm(), $task2);
に似て私のコントローラのアクションを持っているのは、私のMyFormを2つのフィールド
//...
$builder->add('name', 'text');
$builder->add('note', 'text');
//...
それは二つの形式であるためのように思えるがあるとしましょう同じタイプのMyFormのビューでレンダリングされると、フィールドの名前とIDは同じです(2つのフォームの 'name'フィールドは同じ名前とIDを共有します;同じことが 'note'フィールドになります)。 symfonyはフォームのデータを正しくバインドできません。誰もがこれに対する解決策を知っていますか?
// you controller
$entity = new Entity();
$request = $this->getRequest();
$formType = new myType();
$formType->setName('foobar');
// or new myType('foobar'); if you set it in the constructor
$form = $this->createForm($formtype, $entity);
まさに私の考え。素晴らしい答え! –