0
它只是我或它是我的foreach循环表现怪异。我已经做了一个foreach来检查是否有结果被提取,但如果没有,我会显示一条通知/文本确认现在有结果。这里的问题是,如果它不返回任何内容,我将不会显示任何文本。这里似乎是什么问题?Foreach Laravel 4
@extends('layouts.master')
@section('content')
{{ Form::open(['url'=>'flight/onewayflightresults']) }}
<div>
<p>Scheduled Flights</p>
</div>
<table class="table table-hover">
<th>Reserve</th>
<th>#</th>
<th>From</th>
<th>To</th>
<th>Departure</th>
<th>Adult</th>
<th>Children</th>
<th>Fare per person</th>
<th>Book Flight</th>
@foreach($result as $row)
@if(count($row) != 0)
<tr>
<td>{{Form::checkbox('reserve', 'value');}}</td>
<td>{{$row -> id}}</td>
<td>{{$row -> destinationfrom}}</td>
<td>{{$row -> destinationto}}</td>
<td>{{$row -> departure}}</td>
<td>{{{$adult}}}</td>
<td>{{{$child}}}</td>
<td>₱{{{$row -> fare}}}</td>
<td>{{ Form::submit(' ✔ ',array('class'=>'btn btn-success')) }}</td>
</tr>
@else
<p class="bg-danger">Sorry but we have no available flight schedule on your desidered date.</p>
@endif
@endforeach
</table>
{{ Form::close() }}
@endsection
感谢您的时间和答复。这工作像魔术一样。 – staphhelpme 2014-10-04 16:00:47