我正在尝试使用 Laravel 和 twitter bootstrap 设置一个基本页面。我安装了 Laravel 并获得了通用的“你在这里”或 w/e 图像,这样看起来很闪亮。对于 twitter bootstrap,我在 /public 文件夹中添加了 /resources/js、/resources/css 和 /resources/img 下的 twitter bootstrap 文件。
所以现在我正在尝试为我的视图制作一个模板,基本上 twitter bootstrap .css 文件在我的 head 标签中输出, bootstrap.min.js 和 jquery.js 脚本包含在我的结束 body 标签之前输出。
这就是我的设置:
laravel/app/routes.php
Route::get('/', function()
{
return View::make('hello');
});
laravel/app/views/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 文档,但我似乎无法弄清楚我做错了什么..有人能指出我正确的方向吗?