我只看到了如何打开带有链接的 Blade 页面,如何使用按钮来做同样的事情?
问问题
2626 次
2 回答
1
像这样的按钮?
<input type="button"
onClick="parent.location='https://google.com'"
value="Google"
formtarget="_blank">
使用Form
门面:
{!! Form::button('Google', [
'onClick' => "parent.location='https://google.com'",
'formtarget' => 'fromtarget'
])
!!}
并使用Form
外观url()
:
{!! Form::button('Delete account', [
'onClick' => "parent.location='" . url('delete/1') . "'",
'formtarget' => 'fromtarget'
])
!!}
于 2015-11-27T17:43:49.577 回答
1
您可以使用 abutton
或input
元素来执行此操作。
这是一个例子input
:
<input type="submit" onClick="location.href = '{{ url('some/route') }}'">
于 2015-11-27T18:29:42.783 回答