3
@if(Request::is('login') OR Request::is('tags') OR Request::is('categories') OR Request::is('posts') OR Request::is('tags/..') OR Request::is('categories/..') OR Request::is('posts/..') OR Request::is("posts/{$post->id}"))
@include('partials._navAdmin')
@else
@include('partials._nav')
這裏是我的main.blade.php文件中的一個例子,現在我正在做的是我試圖使用2個不同的導航欄 - 我知道有一個更好的方法來做到這一點,但我仍然可以抓不住它!Laravel Request :: is() - 有沒有更好的方法?
我不認爲重複Request ::的好編碼標準是一遍又一遍。我是新手:(我錯過了什麼那邊
感謝您快速回復,確實很有幫助。 –