Laravel - Difference between @yield and @section?

后端 未结 5 1304
鱼传尺愫
鱼传尺愫 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:56

    Just to add on something small, @yield basically defines a section to be injected by overwriting the data and it also works if our view @extends the parent view.

    Now when we overwrite, we replace an implementation completely with a new implementation, like a company can decide to change/overwrite its entire technology if they realize something went wrong.

    It should not be confused with override

提交回复
热议问题