P
P
Pavel Novikov2018-02-27 15:19:39
Template Engines
Pavel Novikov, 2018-02-27 15:19:39

What is the difference between @section and @yield?

I sat down to study Laravel and, in principle, everything is clear after other frameworks, however, there is a question that I can’t find an answer to - what is the difference between

@section
and
@yield
in the Blade template engine? From the documentation, I didn’t really understand what the differences are between them and what to use when?
Could those knowledgeable in Laravel clarify this point? Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Camaro67, 2018-02-27
@paulfcdd

In section , you specify what you want to display somewhere on the page, and yield outputs what you specified in section . At the same time, section can also immediately display, if necessary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question