向@include 添加数据会抛出错误

adding data to @include throws an error

我的代码中有什么错误让我很头疼。

main.blade.php

Html with angular codes here....
@include('modal-template-common', ['link' => route('client.logout')])

模态模板-common.blade.php

{!! Html::link($link, 'OK', ('class'=>'btn btn-danger')) !!}

现在的问题是每当我尝试渲染它时 returns 出现

的错误

ErrorException in UrlGenerator.php line 273

angular.js:11607 Error: [$compile:tpload]

任何启示都会对我有很大帮助。

我不喜欢使用 Html Facade。

但是 ('class'=>'btn btn-danger') 不应该是一个数组吗?

所以,应该是这样的:

{!! Html::link($link, 'OK', array('class'=>'btn btn-danger')) !!}

{!! Html::link($link, 'OK', ['class'=>'btn btn-danger']) !!}

第三个参数是一个array。您可以在此数组中传递任意数量的 key => value 对来分配其他相关标签的属性。在您的情况下,class 属性。

更多选项,参考this link