【发布时间】:2021-06-27 23:28:32
【问题描述】:
我正在 Laravel 项目中寻找解决方案。
<div class="owl-carousel" id="listcarousel">
@foreach ($property->images as $image)
<div class="item"><img src="{{ RvMedia::getImageUrl($image, null, false, RvMedia::getDefaultImage()) }}" class="showfullimg" rel="{{ $loop->index }}" alt="{{ $property->name }}"></div>
@endforeach
</div>
我需要在 foreach 循环中放置一个条件,输出带有以下标记的 jepg 扩展名的文件:
<div class="item"><img src="{{ RvMedia::getImageUrl($image, null, false, RvMedia::getDefaultImage()) }}" class="showfullimg" rel="{{ $loop->index }}" alt="{{ $property->name }}"></div>
以及带有 mp4 扩展名且带有以下标签的文件:
<div class="item"><video src="{{ RvMedia::getImageUrl($image, null, false, RvMedia::getDefaultImage()) }}" class="showfullimg" rel="{{ $loop->index }}" alt="{{ $property->name }}"></video></div>
是的,我将所有电影和照片文件保存在一张桌子上。
【问题讨论】:
-
我们保持大拇指!祝你好运!啊...顺便说一句,您尝试了什么?请阅读how to ask a question。
-
在您的表格中添加一个字段文件扩展名,您可以使用此字段对您的特定文件类型进行分组。