我是新的拉拉和刀片模板引擎。发行:文件form.blade.php
@front.header(‘front.footer’)
首先加载前台/footer.blde.php,然后加载前台/ then er.blde.php的内容。
请找到附件的快照的视图来源。
我查了很少的答案在堆叠溢出,他们说的白色空间,我似乎没有任何。
你好,吉格尼什

发布于 2016-11-10 19:12:53
你不能从两个父母那里@extends。如果您想要包含另一个视图,则应该使用@include代替
就像这样:
@include('front.header')
Content
@include('front.footer')发布于 2016-11-10 19:25:02
这就是我建议的构造主模板的方式。
front._layouts.master:
<!DOCTYPE html>
<html>
<head>
@include('front._layouts.head')
</head>
<body>
<header>
@include('front._layouts.header')
</header>
<main>
@yield('content')
</main>
<footer>
@include('front._layouts.header')
</footer>
@stack('scripts')
</body>
</html>请注意,当您在应用程序中生成健壮的部分时,这个@stack()可能会很有用。堆叠允许您在彼此之上推送到指定的堆栈。
发布于 2016-11-10 19:27:16
遵循以下步骤:
步骤1:
资源\视图创建一个类似于: master.blade.php的文件
步骤2:
资源\视图创建一个文件夹,如:布局
在layout文件夹中创建header & footer文件
步骤3:
在master.blade.php内部,写一下你是如何设计你的主模板的。
<!DOCTYPE html>
<html lang="en">
<head>
<!-- your common css here -->
@yield('partial-css')
</head>
<body>
@include('layouts.top-header')
<div class="container">
@yield('content') <!-- this is your common body -->
</div> <!-- /container -->
@include('layouts.footer')
<!-- your common js here or you also define inside the footer page -->
@yield('script') <!-- this is your individual script for all page -->
</body>
</html>步骤4:现在您将母版页用于所有其他页面,如so index.blade.php
@extends('master')
@section('content')
<!-- Here is your main body content -->
@endsection
@section('script')
<!-- Here is your individual script content -->
@endsection希望你现在了解刀片模板是如何工作的!
https://stackoverflow.com/questions/40535089
复制相似问题