Laravel:找不到[layouts.default] [英] Laravel: View [layouts.default] not found

查看:289
本文介绍了Laravel:找不到[layouts.default]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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)

文件app/views/home.blade.php确实存在.我的主要路线的封闭路线如下:

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

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

什么会改变我的视图结构?

What could have changed the structure of my views?

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

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

@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

推荐答案

文件layouts.default不存在.

请参阅:

@extends('layouts.default')

第一行.

Laravel的作用是在views目录中查找目录layouts,然后尝试在其中加载default文件.该文件不存在,因此会发生错误.

What Laravel does it looks for a directory layouts inside a views directory and tries to load default file inside. This file does not exist so the error occurs.

这篇关于Laravel:找不到[layouts.default]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆