I get an inexplicable FatalErrorException when trying to implement a simple page layout using blade templates. I'm not sure if this is what I am doing wrong, or Laravel. I follow the L4 documentation guide on Templating, and my code seems to follow it. Here is my code.
Application / routes.php:
<?php Route::get('/', ' HomeController@showWelcome ');
app / views / home / welcome.blade.php:
@extends('layouts.default') @section('content') <h1>Hello World!</h1> @stop
app / views / layouts / default.blade.php:
<!doctype html> <html> <head> <title>The Big Bad Barn (2013)</title> </head> <body> <div> @yield('content') </div> </body> </html>
application / controllers / HomeController.php:
<?php class HomeController extends BaseController { protected $layout = 'layouts.default'; public function showWelcome() { $this->layout->content = View::make('home.welcome'); } }
Laravel just throws a FatalErrorException. Is the "Syntax error unexpected" displayed on the output error page? ". The file locator generates inside the PHP storage / views directory, where
<?php echo $__env->make('layouts.default') <?php $__env->startSection('content', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>; ?> <h1>Hello World!</h1> <?php $__env->stopSection(); ?>
source share