I'm facing some error that saying Parse error: syntax error, unexpected '<'
This is my views in Laravel
@for($i = 0;$i < 6;$i++)
<tr>
<td>{{date("Y", strtotime($data[$i]->date))}}</td>
<td>{{date("M", strtotime($data[$i]->date))}}</td>
<td>{{$data[$i]->total}}</td>
<td>{{$st[$i]}}</td>
<td>{{$bt[$i]}}</td>
@if({{$ftm[$i]}}==null)
<td></td>
@elseif({{$ftm[$i]}}!=null)
<td>{{$ftm[$i]}}</td>
@endif
<td>{{$pe[$i]}}</td>
</tr>
@endfor
Is there any solution?
You dont need to add {{ }}
when your variable is in a @if
statement.
Replace:
@if({{$ftm[$i]}}==null)
<td></td>
@elseif({{$ftm[$i]}}!=null)
<td>{{$ftm[$i]}}</td>
@endif
With:
@if($ftm[$i]==null)
<td></td>
@elseif($ftm[$i]!=null)
<td>{{$ftm[$i]}}</td>
@endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With