laravel中的数据循环输出

来源:互联网 发布:c语言temp怎么交换位置 编辑:程序博客网 时间:2024/05/17 01:44
@foreach($sorts as $key=>$sort)    @if ($key%2 == 0)                <li><a class="reacting"  href=""  ><img src="{{$sort -> thumb or /images/type/type_no.png}}" alt=""/><p>{{ $sort -> name  }}</p></a>    @else     <li><a class="other"  href=""  ><img src="{{$sort -> thumb or /images/type/type_no.png}}" alt=""/><p>{{ $sort -> name  }}</p></a>    @endif @endforeach
0 0
原创粉丝点击