Reputation: 95
This is the problem, its not reading @layout()
Inside the folder View/authors/index.blade.php
@layout('layouts.default')
@section('content')
Authors Home Page
@endsection
In the folder Controllers/authors.php
class Authors_Controller extends Base_Controller{
public $restful = true; public function get_index(){ return View::make('authors.index')->with('title', 'Autores e Livros'); }
}
and inside the folder View/layouts/default.blade.php
basic html
<html>
<head> <title> {{ $title }} </title> </head>
<body>
{{ $content }}
</body>
</html>
Where's my error? why is it not reading?
Upvotes: 2
Views: 5541
Reputation: 2050
It seems in Laravel 4 you should use @extends('layouts.default') instead of @layout('layouts.default')
Upvotes: 3
Reputation: 685
First: Inside View/layouts/default.blade.php
<html>
<head> <title> {{ $title }} </title> </head>
<body>
@yield('content')
</body>
</html>
And second: Update
I'm like 99% sure that '@layout('layouts.default')' in your View/authors/index.blade.php is not on the first line. It has to be at the top of the page.
Upvotes: 5