Merge pull request #736 from BenjaminPaap/pass_options

Options for form were not passed through
This commit is contained in:
William Durand 2015-10-26 11:40:51 +01:00
commit 329e226426

View File

@ -306,16 +306,16 @@ class FormTypeParser implements ParserInterface
return $refl->newInstance();
}
private function createForm($item)
private function createForm($item, $data = null, array $options = [])
{
if ($this->implementsType($item)) {
$type = $this->getTypeInstance($item);
return $this->formFactory->create($type);
return $this->formFactory->create($type, $data, $options);
}
try {
return $this->formFactory->create($item);
return $this->formFactory->create($item, $data, $options);
} catch (UnexpectedTypeException $e) {
// nothing
} catch (InvalidArgumentException $e) {