瀏覽代碼

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);
+            }
         }
     }