I'm working on this project using Laravel.
According to this tutorial I'm watching, I had to add this bit of code at the top of the main view.
@include is just like a basic PHP include, it includes a "partial" view into your view.
@extends lets you "extend" a template, which defines it's own sections etc. A template that you can extend will define it's own sections using
@yield, which you can then put your own stuff into in your view file.
<html> <body> @yield('header') @yield('content') @yield('footer') </body> </html>
@extends('template') @section('header') View one's header @endsection @section('content') View one's header @endsection @section('footer') View one's header @endsection
Which will result in:
<html> <body> View one's header View one's content View one's footer </body> </html>
Now you could create another view which extends the same template, but provide's it's own sections.
Another benefit to using
@extend is inheritance. You could provide a base template, and then another child template that extends that one which subsequently yields it's own sections. You can then extend that child template.