小编Ric*_*tiz的帖子

使用 lumen 5.2 和刀片模板引擎?

我按照laravel官方文档使用刀片创建模板。我正在尝试制作我的第一个模板但不起作用。

1)存储在resources/views/default.blade.php --->

<html>
<head>
    @include('includes.head')
</head>
<body>
<div class="container">

    @include('includes.header')


    <div id="main" class="row">

            @yield('content')

    </div>

</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

2)存储在resources/views/home.blade.php -->

@extends('layouts.default')
@section('content')
    I am the Home Page!
@endsection
Run Code Online (Sandbox Code Playgroud)

3)存储在boostrap/app.php -->

$app->get('/', function (){
    return view('home');
});
Run Code Online (Sandbox Code Playgroud)

4) localhost:8000/ 返回这个错误 -->

哎呀,看起来出事了。FileViewFinder.php 第 137 行中的 2/2 ErrorException:未找到视图 [layouts.default]。(查看:/home/vagrant/lumen/resources/views/home.blade.php)

in FileViewFinder.php line 137
at CompilerEngine->handleViewException(object(InvalidArgumentException), '1') in PhpEngine.php line 44
at PhpEngine->evaluatePath('/home/vagrant/lumen/storage/framework/views/96985f6d91158d600b1d1b64b5a3060d84415fda.php', array('__env' => object(Factory), 'app' => object(Application))) in CompilerEngine.php line 59
at CompilerEngine->get('/home/vagrant/lumen/resources/views/home.blade.php', array('__env' => object(Factory), …
Run Code Online (Sandbox Code Playgroud)

laravel blade lumen laravel-5.2 lumen-5.2

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

blade ×1

laravel ×1

laravel-5.2 ×1

lumen ×1

lumen-5.2 ×1