0

I'd like to pass an option to my form so I did this:

            $builder
                ->add('pays', 'collection', array(
                        'type' => new PaysType(),
                        'em' => $this->em,
                        'allow_add' => true,
                )
              );

Although I added em to my form PaysType I got this error: he option "em" does not exist

  public function getDefaultOptions(array $options)
  {
      $options = parent::getDefaultOptions($options);
      $options['em'] = '';
      return $em;
  }

Any ideas?

smarber
  • 4,829
  • 7
  • 37
  • 78

1 Answers1

1

getDefaultOptions() should return the options array but you are returning $em. I think that may be your only problem.

nurikabe
  • 3,802
  • 2
  • 31
  • 39