allow to pass classes wich have constructor arguments

This commit is contained in:
Klein Florian 2012-10-03 16:39:07 +02:00
parent 5c52352eb5
commit f9d4fb90cd

View File

@ -65,7 +65,7 @@ class FormTypeParser implements ParserInterface
public function parse($type) public function parse($type)
{ {
if (is_string($type) && class_exists($type)) { if (is_string($type) && class_exists($type)) {
$type = new $type(); $item = unserialize(sprintf('O:%d:"%s":0:{}', strlen($item), $item));
} }
$form = $this->formFactory->create($type); $form = $this->formFactory->create($type);