【发布时间】:2013-06-07 16:50:26
【问题描述】:
我正在将一个刚开始的 Laravel 3 项目转换为 Laravel 4,并且对刀片模板引擎没有太多乐趣。我知道其中一些内容已更改,但在尝试运行我的网站主页时仍然收到 500 内部服务器错误。它看起来像一些 index.blade.php 文件加载,但 default.blade.php 没有。这很奇怪,因为我在其他页面上仍然有错误,但似乎 default.blade.php 文件至少会加载,即使它没有显示。
default.blade.php
<html>
<head>
{{ HTML::style('css/.css'); }}
{{ HTML::style('css/.css'); }}
{{ HTML::style('css/style.css'); }}
{{ HTML::script('js/jquery.js'); }}
</head>
@yield('content')
<footer>
</footer>
</html>
index.blade.php
@extends('default')
@section('content')
<body>
</body>
@stop
HomeController.php
public function showHome()
{
return View::make('home@index');
}
route.php
Route::get('/', function()
{
return View::make('home.index');
});
【问题讨论】:
-
您的默认文件保存在哪里?什么目录?
-
它在 /views/ 文件夹中
-
附带问题...这 2 个 css 文件应该是空的吗?还是stackoverflow上的错字?
-
还有你为什么要返回两次视图?
-
如果将 route.php 更改为 View::make('default'); 会发生什么并取出产量('内容')。默认显示吗??