繁体   English   中英

Laravel 5.4 array_merge():使用组件表单时参数2不是数组错误

[英]Laravel 5.4 array_merge(): Argument #2 is not an array error while using components forms

当我使用大表格而不是html表格时,它给了我这个错误

settings.blade.php;

 @if (is_array($settings) || is_object($settings))

   @foreach($settings as $set)

      {{ Form::bstext('title', $set->title )}} 
         .
         .
         .
    @endforeach

 @endif     

FormServiceProvider.php

 Form::component('bstext', 'components.form.text', ['name', 'value', 'attributes']);

和text.blade.php

<div class="col-md-4">
<div class="form-group">
    <label>{{$name}}</label>
    {{ Form::text($name, $value, array_merge(['class' => 'form-control'], $attributes)) }}
</div>
</div>

我在哪里弄错了?

我编辑了我的formserviceprovider,它起作用了。

Form::component('input_form', 'components.form.input', ['name', 'value', 'attributes'=>[]]);

感谢@u_mulder

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM