经过一些无用的研究,我不得不问这个问题。
我用的是Laravel 5.6
我有我的控制器
public function index()
{
return view('layout.app');
}
其中app.blade.php如下所示:
<html>
<head>
<title>App Name - @yield('title')</title>
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
child.blade.php是:
@extends('app')
@section('title', 'Page Title')
@section('sidebar')
@parent
<p>This is appended to the master sidebar.</p>
@endsection
@section('content')
<p>This is my body content.</p>
@endsection
这个文件看起来像Laravel教程,它们是,我尝试使用自己的文件,但仍然有相同的错误,所以为了简化使用Laravel的文件。
所以我从来没见过child.blade.php
我在哪里卡住了有什么常见的错误吗?
我以前做过这个,它做得很好,我建立的应用程序非常快,但现在我找不到解决方案。