Laravel 4 blade templates causing FatalErrorException? -


i'm getting unexplained fatalerrorexception when trying implement simple page layout using blade templating. i'm not sure if it's i'm doing wrong or laravel is. i'm following tutorial on l4's documentation templating , code seems follow it. here's code.

app/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> 

app/controllers/homecontroller.php:

<?php class homecontroller extends basecontroller {   protected $layout = 'layouts.default';   public function showwelcome()   {     $this->layout->content = view::make('home.welcome');   } } 

laravel throws fatalerrorexception. output error page says "syntax error, unexpected '?'". file blade generating inside storage/views directory has php

<?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(); ?> 

yesterday encountered same problem did, other answers didn't fix problem. you've figured out already, maybe post prevents others spending time did figuring out wrong while it's such small (but frustrating!) thing.

i'm using notepad++ text-editor , strange reason had decided use "mac format" end-of-line (eol) format. apparently blade framework can't cope that. use conversion function (in notepad++ : edit -> eol conversion) convert windows format , work fine..


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -