【问题标题】:Blade view rendering infinity times刀片视图渲染无限次
【发布时间】:2018-09-20 17:28:51
【问题描述】:

我最近在 laravel 开始了一个新项目。

一切都很顺利,但我遇到了问题。

我在我的项目中设置了 laravel 的内置身份验证

我有一个忘记密码链接,用于通过电子邮件发送重置密码链接。

每当我打开该链接时,用于密码重置的自定义视图都会无限次呈现。

代码:

@extends('layouts.app')

@section('content')
<div class="middle-box text-center loginscreen animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">ABC</h1>

            </div>
            <h3>Welcome to ABC Admin</h3>
            <p>Reset your password.</p>
            <form class="m-t" role="form" method="POST" action="{{ route('password.request') }}">
                @if (session('status'))
                    <div class="alert alert-success">
                        {{ session('status') }}
                    </div>
                @endif
                {{ csrf_field() }}
                <input type="hidden" name="token" value="{{ $token }}">
                <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">

                        <input id="email" type="email" class="form-control" placeholder="Email" name="email" value="{{ old('email') }}" required autofocus>

                        @if ($errors->has('email'))
                            <span class="help-block">
                                <strong>{{ $errors->first('email') }}</strong>
                            </span>
                        @endif
                </div>

                <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">


                        <input id="password" type="password" class="form-control" placeholder="Password" name="password" required>

                        @if ($errors->has('password'))
                            <span class="help-block">
                                <strong>{{ $errors->first('password') }}</strong>
                            </span>
                        @endif

                </div>

                <div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">

                        <input id="password-confirm" type="password" class="form-control" placeholder="Confirm Password" name="password_confirmation" required>

                        @if ($errors->has('password_confirmation'))
                            <span class="help-block">
                                <strong>{{ $errors->first('password_confirmation') }}</strong>
                            </span>
                        @endif

                </div>

                <button type="submit" class="btn btn-primary block full-width m-b">Reset Password</button>

            </form>
            <p class="m-t"> <small>&copy; Copyright {{ date('Y') }}. All rights reserved by ABC.</small> </p>
        </div>
    </div>
@endsection

【问题讨论】:

  • 你能贴一张它的截图吗?我不明白页面如何无限渲染 # 次

标签: php laravel laravel-5.6 laravel-blade


【解决方案1】:

我已经解决了,因为模板中有一个js文件 包含一个代码以包含一个无法包含的演示 html 文件。 那个js错误导致了整个问题。感谢 @IamCavic 抽出宝贵时间。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-17
    相关资源
    最近更新 更多