laravel叶片@include与局部变量

时间:2018-11-27 09:48:51

标签: laravel include laravel-blade laravelcollective

我有此代码:

 @include('admin.members.members_form', ['submitButtonText' => '__('member.edit')'])

并在admin.members.members_form中:

{!! Form::submit($submitButtonText, ['class' => '"btn btn-primary"']) !!}

包含不起作用(在此版本中,单引号引起了错误,我尝试使用\'member.edit \'进行操作没有错误,但是带有文本__('member.edit')的按钮

1 个答案:

答案 0 :(得分:3)

您可以那样做(不带引号)

 @include('admin.members.members_form', ['submitButtonText' => __('member.edit')])