0

Hello,

I am trying to create a picture gallery with laravel:

This is my blade:

setting.blade.php

                                    @if(isset($themes))
                                    @foreach($themes as $m)

                                    <tr>
                                    <td><img width="100px" height="100px" src="{{url('/')}}/uploads/theme/{{$m->pic_name}}.jpg"/></td>
                                    <td><img width="100px" height="100px" src="{{url('/')}}/uploads/theme/{{$m->pic_name}}.jpg"/></td>
                                    <td><img width="100px" height="100px" src="{{url('/')}}/uploads/theme/{{$m->pic_name}}.jpg"/></td>
                                    </tr>

                                    <tr>
                                    <td><div class="box"><input type="checkbox" name="pic" value=""></div></td>
                                    <td><input type="checkbox" name="pic" value=""></td>
                                    <td><input type="checkbox" name="pic" value=""></td>
                                    </tr>

                                    @endforeach
                                    @endif

The above codes would show me a list of three of the same picture in a row and on the next row it changes the picture and again a list of three same picture. I would like each picture all would be different none are the same. How to create such a thing?

Thanks in advance.

2
Contributors
2
Replies
31
Views
1 Month
Discussion Span
Last Post by diafol
0

Sorry, thought of a better way:

@for($i=0;$i<count($theme);$i=$i+3)
<tr>
<td>{{{ $theme[$i] or '' }}}</td>
<td>{{{ $theme[$i] or '' }}}</td>
<td>{{{ $theme[$i] or '' }}}</td>
<tr>
@endfor

Not tested

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.