Tengo un formulario que posee un formulario embebido.
Código PHP:
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'name' => new sfWidgetFormInput(),
'visits_list' => new sfWidgetFormDoctrineChoiceMany(array('model' => 'Protocol')),
));
$this->embedForm('window_id', new PeriodForm);
$this->embedForm('moment_id', new PeriodForm);
Código PHP:
$this->setValidators(array(
'id' => new sfValidatorDoctrineChoice(array('model' => 'ScheduledVisit', 'column' => 'id', 'required' => false)),
'name' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
'visits_list' => new sfValidatorDoctrineChoiceMany(array('model' => 'Protocol', 'required' => false)),
'window_id' => new sfValidatorDoctrineChoice(array('model' => 'Period', 'required' => false)),
'moment_id' => new sfValidatorDoctrineChoice(array('model' => 'Period', 'required' => false)),
));