gpt4 book ai didi

php - 解析错误 : syntax error, 文件意外结束,需要 elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF)

转载 作者:行者123 更新时间:2023-12-04 01:56:29 24 4
gpt4 key购买 nike

你好亲爱的,我想创建一个客户 Blade ,为用户提供导入和导出 excel 文件。我的 customers_blade.php 看起来像这样;

@extends('layouts.app')

@section('content')
<div class="panel-heading">Import and Export Data Into Excel File</div>

<div class="panel-body">
{!! Form::open(array('route'=>'customer.import','method'=>'POST','files'=>'true')) !!}
<div class="row">
<div class="col-xs-10 col-sm-10 col-md-10">
@if(Session::has('success'))
<div class="alert alert-success">
{{Session :: get('message')}}
</div>
@if(Session::has(warning))
<div class="alert alert-warning">
{{Session::get('message')}}
</div>
@endif
<div class="form-group">
{!! Form::label('sample_file','Select File to Import:',['class'=>'col-md-3']) !!}
<div class="col-md-9">
{!! Form::file('customers',array('class'=>'form-control')) !!}
{!! $error->first('products','<p class="alert alert-danger">:message</p') !!}
</div>
</div>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 text-center">
{!! Form::submit('Upload',['class'=>'btn btn-success']) !!}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection

但是当我转到页面时会发生此错误。我该如何编辑它。你能帮我么?

解析错误:语法错误,文件意外结束,需要 elseif (T_ELSEIF) 或 else (T_ELSE) 或 endif (T_ENDIF)( View :/home/vagrant/code/excel/resources/views/customers. Blade .php)

最佳答案

如果您在 blade 文件中注意到您会发现缺少 @endif

                    @if(Session::has('success'))
<div class="alert alert-success">
{{Session :: get('message')}}
</div>
@endif

在上面的部分 @if(Session::has('success')) 这个 If 没有在任何地方结束。

@extends('layouts.app')

@section('content')
<div class="panel-heading">Import and Export Data Into Excel File</div>

<div class="panel-body">
{!!

Form::open(array('route'=>'customer.import','method'=>'POST','files'=>'true')) !!}
<div class="row">
<div class="col-xs-10 col-sm-10 col-md-10">
@if(Session::has('success'))
<div class="alert alert-success">
{{Session :: get('message')}}
</div>
@endif
@if(Session::has(warning))
<div class="alert alert-warning">
{{Session::get('message')}}
</div>
@endif
<div class="form-group">
{!! Form::label('sample_file','Select File to Import:',['class'=>'col-md-3']) !!}
<div class="col-md-9">
{!! Form::file('customers',array('class'=>'form-control')) !!}
{!! $error->first('products','<p class="alert alert-danger">:message</p') !!}
</div>
</div>
</div>
<div class="col-xs-2 col-sm-2 col-md-2 text-center">
{!! Form::submit('Upload',['class'=>'btn btn-success']) !!}
</div>
</div>
{!! Form::close() !!}
</div>
@endsection

希望对你有帮助

关于php - 解析错误 : syntax error, 文件意外结束,需要 elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50210452/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com