PhotoController
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
class PhotoController extends Controller{
public $students=([引入信息]);
public function index(){
$students=$this->students;
$id=null;
$xh=null;
$xingming=null;
$nianji=null;
$zhuanye=null;
$zhuanyebianhao=null;
$banji=null;
$xuexixingshi=null;
$xingbie=null;
$data= compact ('students','id','xh','xingming','nianji','zhuanye','zhuanyebianhao','banji','xuexixingshi','xingbie');
return view('Info',$data);
}
}
Info.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta Http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<title>Document</title>
</head>
<body>
<body>
<h3 style="text-align: center;">学生信息</h3>
<table class="table2_4 " style="text-align: center;" align="center"border=1; >
<tr>
<th>编号</th>
<th>学号</th>
<th>姓名</th>
<th>年纪</th>
<th>专业</th>
<th>专业编号</th>
<th>班级</th>
<th>学习形式</th>
<th>性别</th>
</tr>
@foreach ($students as $item)
<tr align="center" >
<td>{{$item['id']}} </td>
<td>{{$item['xh']}} </td>
<td>{{$item['xingming']}}</td>
<td>{{$item['nianji']}}</td>
<td>{{$item['zhuanye']}}</td>
<td>{{$item['zhuanyebianhao']}}</td>
<td>{{$item['banji']}}</td>
<td>{{$item['xuexixingshi']}}</td>
<td>{{$item['xingbie']}}</td>
</tr>
@endforeach
</table>
</body>
</body>
</html>