how to create a page with blade in laravel

 

 

 

 

 

 

 

 

Now we want to create a page in laravel what should we need for that
as in our html page , there are header, navigation, aside, body, footer tags
Now we would create templates for each as follows:
//app/views/header.blade.php
//app/views/navigation.blade.php
//app/views/aside.blade.php
//app/views/body.blade.php
//app/views/footer.blade.php

Note :they are just for an emaple , you can create as many templates as you want, and name
them as whatsoever you want to give them.

Now come to sexy part of blade extention , it would create a lot for you automatically .
And you do need for changing a whole of code, just pick the required template and make changes
and all is done.ok
//app/views/header.blade.php

<h1>this is my first laravel page</h1>
<p>i want to develop web applications</p>

Now come to //app/views/navigation.blade.php

<nav>
<ul>
<li>Home</li>
<li>Services</li>
<li>Portfolios</li>
<li>Contact Us</li>
<li>About Us</li>
</ul></nav>
//app/views/aside.blade.php
<h3>important news !</h3>
<ul>
<li>first news</li>
<li>Second news</li>
<li>third news</li>
</ul>

 

//app/views/body.blade.php
<p>this is our main body part !<br/>
welcome to laravel</p>
//app/views/footer.blade.php
@copyright2015

 

Now we can create our mainpage with the following code
And in our exmaple template we put them together !
//app/views/example.blade.php

<!doctype html>
4 <html lang=”en”>
5 <head>
6 <meta charset=”UTF-8″>
7 <title>Narwhals</title>
8 </head>
9 <body>

@include(‘header’);
@include(‘navigation’);
@include(‘body’);
@include(‘footer’);
</body>
</html>

for more go to laravel