【发布时间】:2017-07-17 15:43:31
【问题描述】:
我在 Laravel 中构建了演示站点,但出现以下错误:
FileViewFinder.php 第 137 行中的 ErrorException:查看 [layouts.master] 未找到。(查看: /var/www/html/project/laravel/laravel/resources/views/page.blade.php)
master.blade.php 在 page.blade.php 旁边,两者都在资源/视图中
master.blade.php
<html>
<head>
<title>@yield('title')</title>
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@section('content')
</div>
</body>
</html>
page.blade.php
@extends('layouts.master')
@yield('title', 'Page Title')
@section('sidebar')
@parent
<p>This is appended to the master sidebar.</p>
@endsection
@section('content')
<h2>{{$name}}</h2>
<p>This is my body content.</p>
@endsection
出了什么问题?我在this tutorial.工作
【问题讨论】:
-
这个文件夹中有
layouts文件夹和master文件吗? -
不,它们是相邻的。我放入了一个布局文件夹,现在出现任何错误,但 $name 变量没有得到任何值。