Explorar el Código

mmutableArrayType buildForm with FormBuilder as option

Charley Maillot hace 13 años
padre
commit
79f48d93e9
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  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);
+            }
         }
     }