소스 검색

[Form] simplify the code

Victor Berchet 14 년 전
부모
커밋
e56dad6b5e
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      src/Symfony/Component/Form/Form.php

+ 2 - 3
src/Symfony/Component/Form/Form.php

@@ -922,11 +922,10 @@ class Form implements \IteratorAggregate, FormInterface
             $protoView = $prototype->getForm()->createView($view);
             $protoTypes = $protoView->get('types');
             array_unshift($protoTypes, 'prototype');
-            $protoView
+            $childViews[$prototype->getName()] = $protoView
                 ->set('types', $protoTypes)
-                ->set('proto_id', $protoView->getParent()->get('id').'_prototype');
+                ->set('proto_id', $view->get('id').'_prototype');
             ;
-            $childViews[$prototype->getName()] = $protoView;
         }
 
         $view->setChildren($childViews);