Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exclude certain part using layout of laravel

Tags:

php

laravel

I have a layout blade file it has @include('footer')

but in one page I came across this issue : I want to extend that layout but did not want to include the footer.

So what should I do? Is there any way I can check what page is using the layout file in my layout.blade.php?

like image 510
Alex Yong Avatar asked Mar 09 '17 07:03

Alex Yong


2 Answers

You can define a section in your layout:

@section('footer')
    @include('footer')
@show

And then override it in one view:

@section('footer')
{{-- this section will be empty --}}
@stop
like image 86
Zoltan Tolnai Avatar answered Sep 24 '22 18:09

Zoltan Tolnai


Posting this in case anyone still has this problem. One idea is to create a separate master layout that does not include a footer, and extend from there.

like image 31
crafty Avatar answered Sep 23 '22 18:09

crafty