我需要有一个提示框,它将通过Form数组中的键“ onsubmit”进行设置。此版本有效:
{!! Form::model($currentUser,
['route' => ['post.users.current.account.index', $currentUser->id],
'onsubmit' => 'return confirm(\'Are you sure?\')']) !!}
但是我无法对其进行翻译以使其正常运行。到目前为止,我没有成功尝试过此操作:
{!! Form::model($currentUser,
['route' => ['post.users.current.account.index', $currentUser->id],
'onsubmit' => 'return confirm(\''.{{trans('Users::users.current.account.index.box.confirm')}}.'\')']) !!}
是否可以在数组值内连接函数输出?
答案 0 :(得分:1)
请尝试
{!! Form::model($currentUser,
['route' => ['post.users.current.account.index', $currentUser->id],
'onsubmit' => "return confirm('".trans('Users::users.current.account.index.box.confirm')."')"]) !!}