Browse Source

mmutableArrayType buildForm with FormBuilder as option

Charley Maillot 13 năm trước cách đây
mục cha
commit
79f48d93e9
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  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)
     public function buildForm(FormBuilder $builder, array $options)
     {
     {
         foreach($options['keys'] as $infos) {
         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);
+            }
         }
         }
     }
     }