소스 검색

mmutableArrayType buildForm with FormBuilder as option

Charley Maillot 13 년 전
부모
커밋
79f48d93e9
1개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  1. 6 3
      Form/Type/ImmutableArrayType.php

+ 6 - 3
Form/Type/ImmutableArrayType.php

@@ -21,9 +21,12 @@ class ImmutableArrayType extends AbstractType
     public function buildForm(FormBuilder $builder, array $options)
     {
         foreach($options['keys'] as $infos) {
-            list($name, $type, $options) = $infos;
-
-            $builder->add($name, $type, $options);
+            if ($infos instanceof FormBuilder) {
+                $builder->add($infos);
+            } else {
+                list($name, $type, $options) = $infos;
+                $builder->add($name, $type, $options);
+            }
         }
     }