Conditional extends in Blade

后端 未结 3 1894
后悔当初
后悔当初 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:24

    @extends((( Request::ajax()) ? 'layouts.ajax' : 'layouts.default' ))
    

提交回复
热议问题