laravel5.1 - blade 模板未呈现
laravel5.1 - blade template not rendering
我已经尝试了所有 link :
php laravel blade template not rendering
我的代码在这里。
我的 views/layouts/master.blade.php 文件包含
<html>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
我的 views/child.blade.php 文件包含
@extends('layouts.master')
@section('content')
<p>This is my body content.</p>
@endsection
我的 route.php 包含
Route::get('blade', function () {
return view('child');
});
我在浏览器中输入了:
http://localhost/larablog/public/blade
输出为空白页。
我尝试使用非 blade 页面并且它有效,我还将普通变量传递给非 blade 页面也有效。当我尝试使用 blade 模板时,页面似乎总是空白。
请告诉我哪里出错了。
谢谢。
可能是路由问题
Route::get('/blade', function () {
return view:('child');
});
如下link
我在
storage/framework/views 文件夹。
我把文件夹权限改为777,问题都解决了。
如果您 运行 使用 apache,请确保网络服务器对 storage
目录具有 write
权限。
我已经尝试了所有 link : php laravel blade template not rendering
我的代码在这里。
我的 views/layouts/master.blade.php 文件包含
<html>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
我的 views/child.blade.php 文件包含
@extends('layouts.master')
@section('content')
<p>This is my body content.</p>
@endsection
我的 route.php 包含
Route::get('blade', function () {
return view('child');
});
我在浏览器中输入了:
http://localhost/larablog/public/blade
输出为空白页。
我尝试使用非 blade 页面并且它有效,我还将普通变量传递给非 blade 页面也有效。当我尝试使用 blade 模板时,页面似乎总是空白。
请告诉我哪里出错了。 谢谢。
可能是路由问题
Route::get('/blade', function () {
return view:('child');
});
如下link
我在 storage/framework/views 文件夹。 我把文件夹权限改为777,问题都解决了。
如果您 运行 使用 apache,请确保网络服务器对 storage
目录具有 write
权限。