Is there a one line way to include multiple views in laravel 5 - blade?

时间:2015-05-24 21:02:59

标签: laravel-5 blade

I would like to know if its possible to load multiple views in a single line, for example:

@include('view1','view2','view3')

or i have to do this always:

@include('view1')
@include('view2')
@include('view3')

?

1 个答案:

答案 0 :(得分:0)

不,没有。

如果你真的有很多意见要包括在内,你可以这样做:

@foreach(['view1', 'view2', 'view3'] as $view)
    @include($view)
@endforeach