.png)
BLADE
TEMPLATE:
Blade
is the simple, yet powerful templating engine that is included with Laravel.
Unlike some PHP templating engines, Blade does not restrict you from using
plain PHP code in your templates. In fact, all Blade templates are compiled
into plain PHP code and cached until they are modified, meaning Blade adds
essentially zero overhead to your application. Blade template files use
the .blade.php
file extension
and are typically stored in the resources/views
directory.
Viewing
different webpages using a single layout by creating different blade files:
Step 1: First we have
to create a layout of a webpage.
(a)
In the above screenshot that I marked in green. That is the URI we
should give in the route file (web.php) at the end to view different blade
files.
(b) And then footer
(c)
Now I am creating a layout for our
webpage
In the above screenshot I had included two directives
(a)
Include:
Include directive @include is used for showing
static content in master layout. I had include my header and footer
blade file in this layout.
(b) Section:
The @section directive, as the name
implies, defines a section of content. Here I had divided
a section for the body. So that I can change the body of my layout.
Output: