我正在尝试让我的默认模板与 Laravel 一起使用。我来自 Codeigniter 和 Phil Sturgeon 的模板系统,所以我试图以类似的方式来做。任何人都可以帮助我解决我错过的/做错的事情吗?谢谢!
//default.blade.php (located in layouts/default)
<html>
<title>{{$title}}</title>
<body>
{{$content}}
</body>
</html>
//end default.blade.php
//home.blade.php (index view including header and footer partials)
@layout('layouts.default')
@include('partials.header')
//code
@include('partials.footer')
//end home
//routes.php (mapping route to home controller)
Route::controller( 'home' );
//end
//home.php (controller)
<?php
class Home_Controller extends Base_Controller {
public $layout = 'layouts.default';
public function action_index()
{
$this->layout->title = 'title';
$this->layout->content = View::make( 'home' );
}
}
//end