I have never tried something like that, but i think it's possible, or you can do an include.
Feb 4, 2015
7
Level 55
Extending Multiple Blade Hierarchy
I would like to know if it is possible to accomplish the following.
I have the following folder structure
├── articles │ ├── _form.blade.php │ ├── create.blade.php │ ├── edit.blade.php │ ├── index.blade.php │ ├── master.blade.php │ └── show.blade.php ├── auth │ ├── login.blade.php │ ├── password.blade.php │ ├── register.blade.php │ └── reset.blade.php ├── layouts │ ├── app.blade.php │ └── master.blade.php └── welcome.blade.php
layouts/master.blade.php
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Whiteboard</title>
<link rel="stylesheet" href="/css/app.css" type="text/css" media="screen" />
</head>
<body>
<div class="container-fluid">
@yield('tl_content')
</div>
@yield('footer')
</body>
</html>
articles/master.blade.php
@extends('layouts.master')
@section('tl_content')
<div class="row">
<div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12">
@yield('content')
</div>
</div>
@stop
articles/index.blade.php
@extends('articles.master')
@section('content')
<h1>Articles</h1>
<hr>
@foreach ( $articles as $article )
<article>
<h2>
<a href="{{ action('ArticlesController@show', [$article->id]) }}">{{ $article->title }}</a>
</h2>
<div class="body">{{ $article->body }}</div>
</article>
@endforeach
@stop
Please or to participate in this conversation.