Laravel 4:重定向到给定的URL [英] Laravel 4: Redirect to a given url
本文介绍了Laravel 4:重定向到给定的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
laravel的Redirect类中是否有一个方法,其中参数是完整的url?我们都知道这些方法的参数只是路由名称,操作,斜杠等.但是我现在想要的是
Is there a method in Redirect class of laravel where the parameter is a complete url? We all know parameters to these methods are just route name,action, slash,..etc but what I want now is like
return Redirect::foo('https://bla.com/?yken=KuQxIVTNRctA69VAL6lYMRo0');
推荐答案
是的
return Redirect::to('http://heera.it');
更新: Redirect::away('url')
(对于外部链接,Laravel版本4.19):
Update: Redirect::away('url')
(For external link, Laravel Version 4.19):
public function away($path, $status = 302, $headers = array())
{
return $this->createRedirect($path, $status, $headers);
}
这篇关于Laravel 4:重定向到给定的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文