我试图通过循环显示图像。我只能显示像.jpg这样的文件类型。我想显示两种或三种文件类型。
关于如何做的任何想法都将是非常感谢
@foreach($data as $row)
<?php //This code is to display the products next to each other so it looks great
$count++;
if ($count == 6 )
{
$count = 0;
echo '</div>';
echo '<br/>';
echo '<div class="row">';
echo '<div class="col-md-2">';
}
else
{
echo '<div class="col-md-2">';
}
?>
<img class="img-rounded" height="140" width="140" src="/images/catalog/{{$row->sku}}.jpg">
<br/>
<a href="/product/view/{{$row->id}}">{{$row->name}}</a>
<br/>
<br/>
<a class="btn btn-primary" href="/product/view/{{$row->id}}">View</a>
</div>
@endforeach
答案 0 :(得分:0)
删除硬编码的.jpg
<img class="img-rounded" height="140" width="140" src="/images/catalog/{{$row->sku}}">