[Form] Revert changes impacting perfomance and readability

This commit is contained in:
Victor Berchet 2011-06-15 09:45:11 +02:00
parent b709551252
commit 07fa82dff1
2 changed files with 11 additions and 2 deletions

View File

@ -75,6 +75,11 @@ class FieldType extends AbstractType
$fullName = $name;
}
$types = array();
foreach ($form->getTypes() as $type) {
$types[] = $type->getName();
}
$view
->set('form', $view)
->set('id', $id)
@ -90,7 +95,7 @@ class FieldType extends AbstractType
->set('label', $form->getAttribute('label'))
->set('multipart', false)
->set('attr', array())
->set('types', array_map(function ($type) { return $type->getName(); }, $form->getTypes()))
->set('types', $types)
;
}

View File

@ -916,7 +916,11 @@ class Form implements \IteratorAggregate, FormInterface
}
}
$childViews = array_map(function ($child) use ($view) { return $child->createView($view); }, $this->children);
$childViews = array();
foreach ($this->children as $key => $child) {
$childViews[$key] = $child->createView($view);
}
if (null !== $prototype = $view->get('prototype')) {
$protoView = $prototype->getForm()->createView($view);