拉拉维尔的模板
我正在尝试让我的默认模板与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