1

我只看到了如何打开带有链接的 Blade 页面,如何使用按钮来做同样的事情?

4

2 回答 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

您可以使用 abuttoninput元素来执行此操作。

这是一个例子input

<input type="submit" onClick="location.href = '{{ url('some/route') }}'">
于 2015-11-27T18:29:42.783 回答