Conditional extends in Blade

后端 未结 3 1893
后悔当初
后悔当初 2021-01-04 03:04

Is there any way to do a conditional @extends statement in the Blade templating language?

What I\'ve tried:

@if(!Request::ajax())
             


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-04 03:29

    in the master layout:

       @if(!Request::ajax())
    
           //the master layout with @yield('content'). i.e. your current layout
    
       @else
    
           @yield('content')
    
       @endif
    

提交回复
热议问题