问题描述
发布请求后,我需要打开一个新的URL.我已经在控制器的末端完成了此操作.
I need to open a new URL after a post request. I have done this at the end of my controller.
Redirect::away($url)
上述调用非常有效,但是,我想在新标签页中打开URL .
The above calls works perfect, however, I want to open the URL in a new tab.
我试图找到和删除laravel文档中存在的预期方法.没有按预期方式工作.
I tried to, away, and intended methods that are there in the laravel doc. None work as intended.
推荐答案
Redirect::away()
或Redirect:to()
都是服务器端命令,它们所做的只是重定向到url,而
Redirect::away()
or Redirect:to()
both are server side commands and all they do is to redirect to a url with a slight difference as mentioned in this thread
同样,它们都是服务器端命令,它们无法打开新选项卡.
As, both are server side commands they cannot open a new tab.
您需要客户端代码才能打开新标签,例如:<a href="#" target="_blank">Open in a new tab</a>
You need client side code to open new tab, for example:<a href="#" target="_blank">Open in a new tab</a>
这篇关于laravel重定向到新标签页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!