【问题标题】:ErrorException in helpers.php line 519: htmlspecialchars() expects parameter 1 to be string, object givenhelpers.php 第 519 行中的 ErrorException:htmlspecialchars() 期望参数 1 是字符串,给定对象
【发布时间】:2017-02-27 06:43:04
【问题描述】:

上面写着:(查看:C:\xampp\htdocs\lar\resources\views\welcome.blade.php)

我的欢迎刀片代码是:

@if (count($errors) > 0)
    <div class="row">
        <div class="col-md-6">
            <ul>
                @foreach($errors -> all() as $error)
                    <li>{{$errors}}</li>
                @endforeach
            </ul>
        </div>
    </div>
@endif

这里有什么问题?

【问题讨论】:

    标签: laravel laravel-5.2


    【解决方案1】:

    在 foreach 循环中应该是 $error 而不是 $errors

    【讨论】:

    • 我知道这是个愚蠢的错误,无论如何,谢谢:)
    猜你喜欢
    • 2016-05-13
    • 2017-02-11
    • 2015-06-27
    • 1970-01-01
    • 2020-11-22
    • 2018-08-07
    • 2017-08-30
    • 2020-06-01
    • 2018-07-30
    相关资源
    最近更新 更多