Laravel - Difference between @yield and @section?

后端 未结 5 1298
鱼传尺愫
鱼传尺愫 2021-01-31 03:33

From the Laravel docs, you can include \'sections\' inside layouts using two methods:


    
        @section(\'sidebar\')
            Thi         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 03:42

    The shortest answer:

    Use @yield in master if you want to overwrite child data on master layout completely.

    Use @section in master if you want to use master and child data together on child with @parent (Or overwrite child data on master layout like @yield)

提交回复
热议问题