symfony1 - edit multiple database rows in a symfony form -


symfony created dogform class can edit 1 dog entry in database. display form in view use currently:

<?php echo $form; ?> 

well want edit multiple dogs @ once (in 1 page). how do this? think need same form multiple times different initial data (dogs)

you need 1 form, because can submit 1 form @ time, according html spec. form embed collection of dogform.

class dogcollectionform extends sfform {   $dogs = doctrine::gettable('dog')->findall();   foreach ($dogs $i => $dog)   {     $dogform = new dogform($dog);     $this->embedform($i, $dogform);   } } 

as enhancement, pass $dogs form action parameter.


Comments