[Form] Improved the way passed data is handled in FormFactory
This commit is contained in:
parent
335f7e776a
commit
d58c610833
@ -123,6 +123,10 @@ class FormFactory implements FormFactoryInterface
|
|||||||
$knownOptions = array();
|
$knownOptions = array();
|
||||||
$passedOptions = array_keys($options);
|
$passedOptions = array_keys($options);
|
||||||
|
|
||||||
|
if (!array_key_exists('data', $options)) {
|
||||||
|
$options['data'] = $data;
|
||||||
|
}
|
||||||
|
|
||||||
while (null !== $type) {
|
while (null !== $type) {
|
||||||
$type = $this->getType($type);
|
$type = $this->getType($type);
|
||||||
|
|
||||||
@ -160,10 +164,6 @@ class FormFactory implements FormFactoryInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $data) {
|
|
||||||
$builder->setData($data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $builder;
|
return $builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user