我正在尝试使用Laravel和twitter bootstrap设置一个基本页面。我安装了Laravel并获得了通用的“你在这里”或w/e图像,看起来很有光泽。对于twitter bootstrap,我在/ public文件夹中添加了/ boot/resources/js,/ resources/css和/ resources/img下的twitter引导文件。php laravel blade template not rendering
因此,现在我试图为我的视图制作一个模板,其中基本上twitter引导程序.css文件输出在我的head标记中,并且bootstrap.min.js和jquery.js脚本包含在我的输出之前输出关闭车身标签。
所以这是我的设置:
laravel /应用/ routes.php文件
Route::get('/', function()
{
return View::make('hello');
});
laravel /应用/视图/ hello.php
@extends('layouts.master')
@section('content')
<p>This is my body content.</p>
@stop
laravel/app/views/layouts/master.blade.php
<html>
<head>
@section('head')
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/resources/css/bootstrap.min.css" rel="stylesheet" media="screen">
@show
</head>
<body>
<div class="container">
@yield('content')
</div>
@section('footer_scripts')
<script src="http://code.jquery.com/jquery.js"></script>
<script src="/resources/js/bootstrap.min.js"></script>
@show
</body>
</html>
但是它的刀片模板似乎没有渲染。这是我得到的输出:
@extends('layouts.master') @section('content')
This is my body content.
@stop
这就是它在页面以及视图源中的样子。没有html标签或脚本包含;没有。我必须错过一些基本的东西,并且我试着翻阅Laravel文档,但我似乎无法弄清楚我做错了什么。有人能指引我朝着正确的方向吗?
AHA。其实我尝试过,但它仍然在做。我认为这个问题也是,当时我还拼写了'@extends('layouts.master')'放置'layout'而不是'layouts' – slinkhi
@mysql_noobie_xxxx,是的它应该是'layouts'。 –