How to submit multiple forms of same type with one button in symfony2

Viewed 2382

I have the todolist where i display three forms of task type

$task1 = new Task();
$form1 = $this->createForm(new MyForm('f1'), $task1);

$task2 = new Task('fo');
$form2 = $this->createForm(new MyForm('f2'), $task2);

$task3 = new Task();
$form3 = $this->createForm(new MyForm('f3'), $task3);

Now the problem is i have one submit button only . How can i persist these three tasks within one controller. and user can add more forms dynamically as well.

so what the way to solve this

3 Answers
Related