@if后面不要用大括號不要用大括號不要用大括號正確姿勢如此下@if(Auth::user()->id == $article->user_id)
xxx@endif-----以下是原問題,大家自由鄙視-----我想在blade中判斷是不是用戶自己的東西,所以我寫了下面的代碼:@if({{ Auth::user()->id == $article->user_id }})
<a class="ui right floated blue button" href="{{ route('article.edit',$article->id) }}">編輯</a>
<a class="ui right floated red button" href="#">刪除</a>@endif但是laravel報錯了,報錯內容如下:syntax error, unexpected '<' (View: D:\website\www\mobook\resources\views\article\index.blade.php)根本找不到哪里有提示的這個錯誤符號啊
laravel中的if我錯在哪了(已解決)
慕運維8079593
2018-10-24 20:03:57