laravel(part6-layout)
- sondip poul singh
- Jan 17, 2019
- 1 min read
make a new view named layout.blade.php
copy all from the welcome view. now look at the followings:
<div class="content"> <div class="title m-b-md"> @yield('content')
</div>
</div>
use @yield('any_name'). this states we will write a content here.Now in other view pages where we want to use this layout we write
@extends('layout') //taking the layout named layout.blade.php
@section('content') //yielded before
My DEsiGn //write anything
@stop
N.B. we can use any number of @yield and @section.
Comentarios