php laravel刀片模板不呈现

sli*_*khi 10 php twitter-bootstrap laravel

我正在尝试使用Laravel和twitter bootstrap设置基本页面.我安装了Laravel并获得了通用的"你在这里"或w/e图像,因此看起来很闪亮.对于twitter bootstrap,我在/ resources/js,/ resources/css和/ resources/img下的/ boot文件夹中添加了twitter bootstrap文件.

所以现在我正在尝试为我的视图制作一个模板,其中twitter bootstrap .css文件基本上都是在我的head标签中输出的,而bootstrap.min.js和jquery.js脚本包含在我的关闭body标签之前输出.

所以这就是我的设置:

laravel /应用程序/ routes.php文件

Route::get('/', function()
{
        return View::make('hello');
});
Run Code Online (Sandbox Code Playgroud)

laravel /应用/视图/ hello.php

@extends('layouts.master')

@section('content')
    <p>This is my body content.</p>
@stop
Run Code Online (Sandbox Code Playgroud)

laravel /应用/视图/布局/ 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>
Run Code Online (Sandbox Code Playgroud)

但它的刀片模板似乎没有渲染.这是我得到的输出:

@extends('layouts.master') @section('content')
This is my body content.

@stop
Run Code Online (Sandbox Code Playgroud)

这就是它在页面上以及在视图源中的外观.没有html标签或脚本包括; 没有.我必须遗漏一些基本的东西,并且我已经尝试查看Laravel文档,但我似乎无法弄清楚我做错了什么...有人能指出我正确的方向吗?

The*_*pha 22

要使用刀片模板,您必须具有.blade文件名,例如在您的情况下应该是

hello.blade.php
Run Code Online (Sandbox Code Playgroud)

否则,它将无法渲染.阅读Laravel网站上的更多内容.这是我的一个测试项目(index.blade.php)的一个例子,因为你有一个错字@extends('layout.master')它应该是这样的

@extends('layouts.master')

@section('content')
This is a sample of laravel 4 using blade template engine.
This is home page using HomeController and home.blade template.
@stop
Run Code Online (Sandbox Code Playgroud)