S
S
Stepan2016-01-06 00:32:33
Laravel
Stepan, 2016-01-06 00:32:33

Laravel 5.1 how to not render one element in layout for one page?

I have a common layout for all pages, in it I include search forms in the header.
But on the global search page, I would not want to display
it How to do it beautifully, check the title or route, the only thing that came to mind
Layout -> include(search.form) -> page

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Plisko, 2016-01-06
@AmdY

For example like this

// в layout.blade.php
@section('search')
    @include('search.form')
@endsection


// в шаблоне где вывод не нужно делаем блок пустым
@section('search')
@endsection

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question