php Laravel:未找到查看 [layouts.default]

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23144197/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:31:40  来源:igfitidea点击:

Laravel: View [layouts.default] not found

phplaravel-4

提问by Chris Schmitz

I installed a bundle in my project that defines it's own views. While navigating through the site after making some changes, I found that all of my actions that happen with the bundled views work fine, but when I go back to the head route, I get an error message:

我在我的项目中安装了一个包来定义它自己的视图。在进行了一些更改后浏览网站时,我发现我在捆绑视图中发生的所有操作都可以正常工作,但是当我返回主路由时,我收到一条错误消息:

View [layouts.default] not found. (View: /var/www/app/views/home.blade.php)

The file app/views/home.blade.phpdefinitely exists. The closure for my head route looks like this:

该文件app/views/home.blade.php肯定存在。我的头部路线的闭合看起来像这样:

Route::get('/', array('as' => 'home', function()
{
    return View::make('home');
}));

What could have changed the structure of my views?

什么可以改变我的观点的结构?

EDIT:

编辑:

Here's the contents of my home.blade.php file:

这是我的 home.blade.php 文件的内容:

@extends('layouts.default')

{{-- Web site Title --}}
@section('title')
@parent
{{trans('pages.helloworld')}}
@stop

{{-- Content --}}
@section('content')

<div class="jumbotron">
  <div class="container">
    <h1>{{trans('pages.helloworld')}}</h1>
    <p>{{trans('pages.description')}}</p>
  </div>
</div>

@if (Sentry::check() )
    <div class="panel panel-success">
         <div class="panel-heading">
            <h3 class="panel-title"><span class="glyphicon glyphicon-ok"></span> {{trans('pages.loginstatus')}}</h3>
        </div>
        <div class="panel-body">
            <p><strong>{{trans('pages.sessiondata')}}:</strong></p>
            <pre>{{ var_dump(Session::all()) }}</pre>
        </div>
    </div>
@endif 


@stop

回答by Linek

File layouts.defaultdoes not exists.

文件layouts.default不存在。

See:

看:

@extends('layouts.default')

First line.

第一行。

What Laravel does it looks for a directory layoutsinside a viewsdirectory and tries to load defaultfile inside. This file does not exist so the error occurs.

什么Laravel做它寻找一个目录layouts一个内部views目录,并尝试加载default文件中。此文件不存在,因此发生错误。