I have a Collection Form
class MyCollectionForm extends sfForm
{
public function configure()
{
parent::configure();
$this->widgetSchema->setNameFormat('my_collection[%s]');
$groups = Doctrine::getTable('QuotaGroup')->findAll(); //existing groups
foreach ($groups as $i => $group)
{
$groupForm = new QuotaGroupForm($group);
$this->embedForm($i, $grou开发者_JS百科pForm);
}
$i++;
$this->embedForm($i, new QuotaGroupForm(new QuotaGroup())); //new group
$this->mergePostValidator(new QuotaGroupValidatorSchema());
}
}
In the Save Action I do:
$this->form->bind($params);
if($this->form->isValid())
{
$this->form->save();
}
I get an error: Call to undefined method MyCollectionForm::save()
I cant´t find the error because sfForm has a save method...
sfForm does not have a save method...
You should extend sfFormDoctrine.
class MyCollectionForm extends sfFormDoctrine{ ...
精彩评论