【发布时间】:2016-01-26 13:50:41
【问题描述】:
我有一个表格,这个表格是给员工的,每个员工每年都有一笔付款,管理员应该填写数据并保存,以前的数据也应该填写在表格的正确位置,否则如果有没有数据,输入字段应该为空,数据应该是这样的:
我的密码: 控制器
$years = Year::with('employeeData')->get();
$indicators = Indicator::all();
return view('sustainability-data.input-data', compact('years', 'indicators'));
查看
@foreach($employees as $index=>$employee)
<tr>
<td>{{$employee->name}}</td>
@foreach($years as $year)
<td>
@foreach($year->employeeData as $datum)
@if($datum->employee_id == $employee->id)
{!! Form::text('row[$index][value]' ,$datum->value,['class' => 'form-control']) !!}
@endif
@endforeach
</td>
@endforeach
在我失去理智之前,任何人都知道如何解决这个问题,我尝试了很多方法,但我没有解决这个问题
【问题讨论】:
标签: php forms laravel-5.1