Issue
I am new to laravel and php. I have this code in one of my controllers:
$group_by_precedence = array("true", "false");
And this code in the view:
@foreach ($group_by_precedence as $value)
<thead>
<tr>
<th colspan="8">
<a class="collapse-button collapsed"
data-toggle="collapse"
href="#collapse_&&&&&"
aria-expanded="true"
aria-controls="collapse_&&&&&"
onclick="loadDealsFor(&&&&&, 'precedence');"
style="width: 100%; display: block; margin: -10px; padding: 10px;"
>
<i class="zmdi zmdi-plus"></i> <i class="zmdi zmdi-minus"></i> exists
</a>
</th>
</tr>
</thead>
@endforeach
I tried but I did not manage to duplicate the code twice, and replace the &&&&&
with the values from the $group_by_precedence
array; first true
and then false
.
Currently the bad solution is to duplicate the code in the view, and just change the &&&&&
with true
and false
.
Solution
Hope it might help:
<thead>
<tr>
@foreach ($group_by_precedence as $value)
<th colspan="8">
<a class="collapse-button collapsed"
data-toggle="collapse"
href="#collapse_{{ $value }}"
aria-expanded="true"
aria-controls="collapse_{{ $value }}"
onclick="loadDealsFor({{ $value }}, 'precedence');"
style="width: 100%; display: block; margin: -10px; padding: 10px;"
>
<i class="zmdi zmdi-plus"></i> <i class="zmdi zmdi-minus"></i> exists
</a>
</th>
@endforeach
</tr>
</thead>
Answered By - Saied Islam Shuvo Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.