htmlspecialchars() 期望参数 1 为字符串
在实际环境中获取日志报告时出现此错误。并不是所有的报告,而是一些报告
这是我在控制器中的
participateOfficersArray
:
array_push($participateOfficersArray, [
'officer_id' => $officer_id,
'officer_name' => $officer_name,
'officer_position' => $officer_position,
//''date' => $participateOfficer->officer_dates,
'date' => $officerDaysArray,
]);
这是刀片文件:
@foreach($participateOfficersArray as $participateOfficersArray)
<tr>
<td>{{$participateOfficersArray['officer_id']}}</td>
<td>
<div class="editable">{{$participateOfficersArray['officer_name']}}</div>
</td>
<td>
<div class="editable">{{$participateOfficersArray['officer_position']}}</div>
</td>
<td>
<table>
@foreach($participateOfficersArray['date'] as $officerDaysArray)
<tr>
<td>{{$officerDaysArray}}</td>
</tr>
@endforeach
</table>
</td>
</tr>
@endforeach
这应该适合你
试试这个:
@foreach($participateOfficersArray as $item)
<tr>
<td>{{$item['officer_id']}}</td>
<td>
<div class="editable">{{$item['officer_name']}}</div>
</td>
<td>
<div class="editable">{{$item['officer_position']}}</div>
</td>
<td>
<table>
@foreach($item['date'] as $officerDaysArray)
<tr>
<td>{{$officerDaysArray}}</td>
</tr>
@endforeach
</table>
</td>
</tr>
@endforeach