Php laravel 5 fatalexception 文件意外结束
Php laravel 5 fatalexception unexpected end of file
我有以下代码片段来结束 php 和 laravel 中的文件。
@extends('master')
@section('content')
<p>Hello World</p>
@endsection
master.blade.php 文件如下
<!doctype html>
<html lang="em">
<head>
<meta charset="UTF-8">
<title>{{ $title }}</title>
{{ HTML::style('css/bootstrap.css') }}
{{ HTML::script('js/bootstrap.js') }}
{{ HTML::script('js/jquery.js') }}
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
{{ HTML::link('/','login',array('class' => 'brand')) }}
<ul class="nav pull-right">
@if(Auth::user())
<li>{{ HTML::link('logout', 'Logout') }}</li>
@else
<li>{{ HTML::link('login','login') }}</li>
</ul>
</div>
</div>
<div class="container">
@yield('content')
</div>
但是,我收到以下错误:
FatalErrorException in 4d94a10943d3d038e850b4e898e794a8 line 33:
syntax error, unexpected end of file
使用 blade 模板在 laravel、php 中结束文件的语法到底是什么。
您缺少 @endif
指令。您的 blade 语法需要是:
@if(Auth::user())
<li>{{ HTML::link('logout', 'Logout') }}</li>
@else
<li>{{ HTML::link('login','login') }}</li>
@endif
如果没有 @endif
指令,您将收到 "unexpected end of file" 错误。
我有以下代码片段来结束 php 和 laravel 中的文件。
@extends('master')
@section('content')
<p>Hello World</p>
@endsection
master.blade.php 文件如下
<!doctype html>
<html lang="em">
<head>
<meta charset="UTF-8">
<title>{{ $title }}</title>
{{ HTML::style('css/bootstrap.css') }}
{{ HTML::script('js/bootstrap.js') }}
{{ HTML::script('js/jquery.js') }}
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
{{ HTML::link('/','login',array('class' => 'brand')) }}
<ul class="nav pull-right">
@if(Auth::user())
<li>{{ HTML::link('logout', 'Logout') }}</li>
@else
<li>{{ HTML::link('login','login') }}</li>
</ul>
</div>
</div>
<div class="container">
@yield('content')
</div>
但是,我收到以下错误:
FatalErrorException in 4d94a10943d3d038e850b4e898e794a8 line 33:
syntax error, unexpected end of file
使用 blade 模板在 laravel、php 中结束文件的语法到底是什么。
您缺少 @endif
指令。您的 blade 语法需要是:
@if(Auth::user())
<li>{{ HTML::link('logout', 'Logout') }}</li>
@else
<li>{{ HTML::link('login','login') }}</li>
@endif
如果没有 @endif
指令,您将收到 "unexpected end of file" 错误。