laravel blade回声错位

laravel blade echo misplacement

据我了解的一点点 Laravel 我对发生的事情感到很困惑。

Browser output

Blade 正在加载模板

<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

目的是创建一个 table 行,每行都有一个值打印到其中

试试这个代码,让我知道你是否遇到任何问题

<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
<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