FatalErrorException : 语法错误,意外的“:”,需要“,”或“;” 在 Laravel

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28655638/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 10:59:38  来源:igfitidea点击:

FatalErrorException : syntax error, unexpected ':', expecting ',' or ';' in Laravel

phplaravellaravel-5

提问by Kiran Subedi

This thing is bugging me a lot. I'm getting this parse error: syntax error, unexpected ':', expecting ',' or ';' in /opt/lampp/htdocs/pratice/storage/framework/views/36f62563d0e17e05a5f15bec012dd0cd at line 21

这件事让我很烦恼。我收到此解析错误: syntax error, unexpected ':', expecting ',' or ';' in /opt/lampp/htdocs/pratice/storage/framework/views/36f62563d0e17e05a5f15bec012dd0cd at line 21

My view file is

我的视图文件是

@extends('layouts.loginlayout')

@section('content')

    @if (session('status'))
        <div class="alert alert-success">
            {!! session('status') !!}
        </div>
    @endif

    @if (count($errors) > 0)
        <div class="alert alert-danger">
            <strong>Whoops!</strong> There were some problems with your input.<br><br>
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{!! $error !!}</li>
                @endforeach
            </ul>
        </div>
    @endif 
//this is line 21
    {!! Form:open() !!}
        <div class="form-group">
            {!! Form::label('email','Email:') !!}
            {!! Form::text('email',null,['class'=>'form-control','id'=>'email']) !!}
        </div>

        {!! Form::submit('Login',['class'=>'btn pull-right default-button']) !!}


    {!! Form:close() !!}

@endsection

回答by Adrian Cid Almaguer

Change {!! Form:open() !!}to

更改 {!! Form:open() !!}

  {!! Form::open() !!}

and {!! Form:close() !!}to

{!! Form:close() !!}

{!! Form::close() !!}