0
点赞
收藏
分享

微信扫一扫

软件20-4 陈珊珊 Laravel 3

东言肆语 2022-04-03 阅读 32
laravel

hello.blade.php

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <link rel="stylesheet" type="text/css" href="{{asset('css/bootstrap.min.css')}}">
</head>
<body>
<div class="container">
    <div class="row">
         <table class="table  ">
            <caption>学生信息表</caption>
            <thead>
            <tr>
                <th>编号</th><th>学号</th><th>姓名</th><th>年级</th><th>专业</th><th>班级</th><th>性别</th>
            </tr>
            </thead>
         <tbody>
    @foreach($students as $item)
        @if($loop->index%2)
        <tr class="bgcolor">
        @else
        <tr>
        @endif
            <td>{{$loop->index}}::{{$item['id']}}</td>
            <td>{{$item['xh']}}</td>
            <!-- <td><a href="http://www.chen.com/user/{{$item['xh']}}">{{$item['xingming']}}</a></td> -->
            <!-- <td><a href="{{url('user/'.$item['xh'])}}">{{$item['xingming']}}</a></td> -->
            <td><a href="{{route('user.show',$item['xh'])}}">{{$item['xingming']}}</a></td>
            <td>{{$item['nianji']}}</td>
            <td>{{$item['zhuanye']}}</td>
            <td>{{$item['banji']}}</td>
            <td>{{$item['xingbie']}}</td>
        </tr>
    @endforeach
    </tbody>
</table>
    </div>
</div>

<style type="text/css">
    .bgcolor{
        background-color: powderblue;
    }
</style>

</body>
</html>

detail.blade.php

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    <link rel="stylesheet" type="text/css" href="{{asset('css/bootstrap.min.css')}}">
</head>
<body>
    <h2>详细信息</h2>
    @if(empty($stu))
    没有该学生信息
    @else
    <div>
        {{$stu['xh']}}
        {{$stu['xingming']}}
        {{$stu['nianji']}}
        {{$stu['zhuanye']}}
        {{$stu['banji']}}
        {{$stu['xingbie']}}
    </div>
    @endif
</body>
</html>

在这里插入图片描述
在这里插入图片描述

举报

相关推荐

0 条评论