我试图通过访问foreach循环来比较数据库中的值,并将其与给定的字符串“备抵”进行比较,数据库中的$scholar->scholarship_name值也是also。所以,这应该是真的,但我下面有个错误.
以下是错误:
语法错误,意外的“<”
以下是代码:
@foreach($scholars as $scholar)
{!! $scholar->sponsor_name !!}
{!! $scholar->scholarship_name !!}
11-7-2014
@if ( {!! $scholar->scholarship_name !!} == 'allowance')
I have one record!
@else
I don't have any records!
@endif
@endforeach发布于 2016-09-27 18:11:21
使用@刀片语法时,您已经在PHP解析器中了。你不需要逃避你的变数。
@if ( $scholar->scholarship_name == 'allowance')https://stackoverflow.com/questions/39731461
复制相似问题