laravel刀片回声错位

时间:2017-11-22 13:59:05

标签: php html laravel blade

从我对Laravel Im的了解中,我发现了很多事情。

Browser output

正在加载的刀片模板

<link rel='stylesheet' type='text/css' href="{{asset('/css/app.css')}}">
<a href='{{route("overview")}}'>Overview</a>
<a href='{{route("view", "Supplier")}}'>Suppliers</a>
<a href='{{route("view","resource")}}'>Resources</a>
<a href='{{route("view","price")}}'>Prices</a>
<a href='{{route("view","recipe")}}'>Reciepes</a>
<a href='{{route("add", $current)}}'>Add</a>
@if($modal)
<table>
<tr>
@foreach($modal->get_display_fields() as $e)
    <th> {{$e->label}} </th>
@endforeach
</tr>
@foreach($items as $item)
    {{$item->init_fields()}}
    @foreach($item->get_display_fields() as $q) 
        <tr>
        {{$q->value}}
        </tr>
    @endforeach

@endforeach
</table>
@endif

目的是创建一个包含行的表,每个行都打印一个值

2 个答案:

答案 0 :(得分:1)

尝试使用此代码并了解您是否遇到任何问题

<link rel='stylesheet' type='text/css' href="{{asset('/css/app.css')}}">
<a href='{{route("overview")}}'>Overview</a>
<a href='{{route("view", "Supplier")}}'>Suppliers</a>
<a href='{{route("view","resource")}}'>Resources</a>
<a href='{{route("view","price")}}'>Prices</a>
<a href='{{route("view","recipe")}}'>Reciepes</a>
<a href='{{route("add", $current)}}'>Add</a>
@if($modal)
<table>
<tr>
@foreach($modal->get_display_fields() as $e)
    <th> {{$e->label}} </th>
@endforeach
</tr>
@foreach($items as $item)
    {{$item->init_fields()}}
    @foreach($item->get_display_fields() as $q) 
        <tr>
        <td>{{$q->value}}</td>
        </tr>
    @endforeach
@endforeach
</table>
@endif

答案 1 :(得分:1)

<link rel='stylesheet' type='text/css' href="{{asset('/css/app.css')}}">
<a href='{{route("overview")}}'>Overview</a>
<a href='{{route("view", "Supplier")}}'>Suppliers</a>
<a href='{{route("view","resource")}}'>Resources</a>
<a href='{{route("view","price")}}'>Prices</a>
<a href='{{route("view","recipe")}}'>Reciepes</a>
<a href='{{route("add", $current)}}'>Add</a>
@if($modal)
<table>
<tr>
@foreach($modal->get_display_fields() as $e)
    <th> {{$e->label}} </th>
@endforeach
</tr>
@foreach($items as $item)
    {{$item->init_fields()}}
    @foreach($item->get_display_fields() as $q) 
        <tr>
           <td>{{$q->value}}</td>
        </tr>
    @endforeach
@endforeach
</table>
@endif