我正在使用laravel并且每个循环都有一个api响应,
这会循环一些html accoridan和php数据,效果很好。
接下来在accoridan下拉列表中我有第二个循环,循环通过一个单独的ojbects数组来显示我需要的数据。
我应该组合数组吗?制动第一个回路? 不确定下一步
这是我的观点
@foreach(array_slice($nearbysearchresults->results, 0, 5) as $result)
<div class="accordion" id="toggleArea">
<div class="accordion-group">
<div class="accordion-heading accordionize">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordionArea" href="#{{$result->place_id}}Area">
{{$result->name}}
{{$result->vicinity}}
<td><span class="font-icon-ok-sign" style="padding-left: 10px;"></span></td>
<td><span class="font-icon-ok-sign" style="padding-left: 10px;"></span></td>
<td><span class="font-icon-ok-sign" style="padding-left: 10px;"></span><span class="font-icon-ok-sign" style="padding-left: 10px;"></span><span class="font-icon-ok-sign" style="padding-left: 10px;"></span><span class="font-icon-ok-sign" style="padding-left: 10px;"></span><span class="font-icon-ok-sign" style="padding-left: 10px;"></span></td>
<td><span class="font-icon-ok-sign" style="padding-left: 10px;"></span><span class="font-icon-ok-sign" style="padding-left: 10px;"></span><span class="font-icon-ok-sign" style="padding-left: 10px;"></span><span class="font-icon-ok-sign" style="padding-left: 10px;"></span><span class="font-icon-ok-sign" style="padding-left: 10px;"></span></td>
<td></td>
<td></td>
<td></td>
</a>
</div>
<div id="{{$result->place_id}}Area" class="accordion-body collapse">
<div class="accordion-inner">
<div class="row">
<div class="span12">
<div class="info-block">
<div class="info-text">
<p>test</p>
@foreach($placesearchresults as $placesearchresult)
{{$placesearchresult->result->name}}
@endforeach
<a class="button" target="_blank" href="">Visit Site</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endforeach