Lynx
Lynx

Reputation: 1482

Laravel 4 Blade Template Engine not working

I am converting over a beginning Laravel 3 project into Laravel 4 and not having so much fun with the blade template engine. I know some of the stuff has changed but I still get a 500 Internal Server Error when trying to run the main page of my site. It looks like some of the index.blade.php files loads but the default.blade.php does not. Which is weird because I still have errors on my other pages but it seems like the default.blade.php file at least loads even though it doesnt show.

default.blade.php

<html>
<head>
     {{ HTML::style('css/.css'); }}
     {{ HTML::style('css/.css'); }} 
     {{ HTML::style('css/style.css'); }}
     {{ HTML::script('js/jquery.js'); }}
</head>
@yield('content')
<footer>
</footer>
</html>

index.blade.php

@extends('default')

@section('content')
<body>

</body>
@stop

HomeController.php

    public function showHome()
{
    return View::make('home@index');
}

route.php

    Route::get('/', function()
{
    return View::make('home.index');
});

Upvotes: 0

Views: 2822

Answers (1)

kJamesy
kJamesy

Reputation: 6233

Option 1

routes.php

Route::get('/', 'HomeController@showHome'); //delete everything else

HomeController.php

public function showHome()
{
  return View::make('home.index');
}

Option 2

Try running your code again; it should work since you are not registering the controller and so it's not run. Anyway, if it doesn't, simply get rid of HomeController.php. Your routes.php is fine (if you aren't using Controllers)

Upvotes: 1

Related Questions