我的工作项目简单,但我收到错误:
350957ec60e1dd25a26f206394651974bb23e6b7.php行中的ErrorException 40:数组到字符串的转换(查看: C:\ XAMPP \ htdocs中\ laravelku \资源\视图\ siswa \ edit.blade.php)
这是我的代码:
@extends('template')
@section('main')
<div id="siswa">
<h2>Edit Siswa</h2>
{!! Form::model($siswa,['method' => 'PATCH', 'action' => ['SiswaController@update', $siswa->id]]) !!}
<div class="form-group">
{!! Form::label('nisn', 'NISN:', ['class' => 'control-label']) !!}
{!! Form::text('nisn', null,['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::label('nama_siswa','Nama:',['class' => 'control-label']) !!}
{!! Form::text('nama_siswa',null,['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::label('tanggal_lahir','Tanggal Lahir:',['class' => 'control-label']) !!}
{!! Form::date('tanggal_lahir',null,['class' => 'form-control','id' => 'tanggal_lahir']) !!}
</div>
<div class="form-group">
{!! Form::label('jenis_kelamin','Jenis Kelamin:', ['class' => 'control-label']) !!}
<div class="radio">
<label>{!! Form::radio('jenis_kelamin', 'L') !!} Laki-laki</label>
</div>
<div class="radio">
<label>{!! Form::radio('jenis_kelamin','P') !!} Perempuan</label>
</div>
</div>
<div class="form-group">
{!! Form::submit('Update Siswa'), ['class' => 'btn btn-primary form-control'] !!}
</div>
{!! Form::close() !!}
</div>
@stop
@section('footer')
@include('footer')
@stop
答案 0 :(得分:1)
Form::submit()
语法错误。改变这个:
{!! Form::submit('Update Siswa'), ['class' => 'btn btn-primary form-control'] !!}
对此:
{!! Form::submit('Update Siswa', ['class' => 'btn btn-primary form-control']) !!}