laravel 路由的demo

来源:互联网 发布:印度的种姓制度 知乎 编辑:程序博客网 时间:2024/06/03 20:07
<!DOCTYPE html><html>    <head>        <title>Laravel</title>        <style>            html, body {                height: 100%;            }            body {                margin: 0;                padding: 0;                width: 100%;                display: table;                font-weight: 100;                font-family: 'Lato';            }            .container {                text-align: center;                display: table-cell;                vertical-align: middle;            }            .content {                text-align: center;                display: inline-block;            }            .title {                font-size: 96px;            }        </style>    </head>    <body>        <div class="container">            <div class="content">                <div class="title">Laravel 5 </div>                <div class="title">                    {{-- 注释内容 --}}                    {!!$cc or '<script>alert(123);</script>'!!}{{-- 默认值 及非转义输出 --}}                    {{@datetime}}{{-- 自定义模版标签 --}}                    {{-- 添加条件 --}}                    <?php $a = 3;?>                    <?php $users = array('admin','good user');?>                    {{-- if条件 --}}                    @if($a == 1)                        1                    @elseif($a == 2)                        2                    @else                        3                    @endif                    {{-- unless条件 --}}                    @unless($a == 3)                        unless 3                    @endunless                    {{-- for条件 --}}                    @for($i=0;$i<3;$i++)                        {{$i}}                    @endfor                    {{-- foreach条件 --}}                    @foreach($users as $user)                        {{$user}}                    @endforeach                    {{-- forelse条件 --}}                    @forelse($users as $user)                        forelse 4                        {{$user}}                    @empty                        forelse empty 4                    @endforelse                    {{-- while条件 --}}                    @while($a == 5)                        while 5                    @endwhile                    {{-- include条件 --}}                    @include('job', ['job' => 'job value'])                    {{-- each条件 --}}                    <?php                        $boy = array(1,2,3,4);                    ?>                    @each('job2',$boy,'data')                    <form>                        <input type="hidden" name="_token" value="{{csrf_token()}}"/>                        {{ csrf_field() }}                        {{ method_field('PUT') }}                    </form>                </div>            </div>        </div>    </body></html>
0 0
原创粉丝点击