jqh 5 年之前
父节点
当前提交
b88fb562f8
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Form/Field.php

+ 5 - 1
src/Form/Field.php

@@ -460,7 +460,11 @@ class Field implements Renderable
             $options = $options->toArray();
         }
 
-        $this->options = array_merge($this->options, $options);
+        if (is_array($this->options)) {
+            $this->options = array_merge($this->options, $options);
+        } else {
+            $this->options = $options;
+        }
 
         return $this;
     }