【发布时间】:2014-08-14 09:18:51
【问题描述】:
我在app/layout/ 文件夹中有刀片模板,即default.blade.php
<!doctype html>
<html>
<head>
@include('includes.head')
</head>
<body>
<div class="container">
<header class="row">
@include('includes.header')
</header>
<div id="main" class="row">
@yield('content')
</div>
<footer class="row">
@include('includes.footer')
</footer>
</div>
</body>
</html>
文件夹结构:
app/views/layout/default.blade.php
app/views/includes/footer.blade.php
app/views/includes/head.blade.php
app/views/includes/header.blade.php
我的控制器是blade.php
<?php
class Blade extends BaseController
{
public function layout()
{
return View::make('layout.default');
}
}
?>
Routes.php
Route::get('blade','Blade@layout');
我将控制器指向浏览器,例如:
http://localhost/laravel/public/blade
显示错误:
Call to undefined method Illuminate\Support\Facades\Blade::getAfterFilters()
我该如何解决。请帮帮我。
【问题讨论】:
-
根命名空间中的
class Blade在 Laravel 中为Blade别名保留。将您的控制器名称更改为更具表现力的名称。 -
@大卫。运行良好,谢谢