Laravel 4:重定向到给定的网址 [英] Laravel 4: Redirect to a given url

查看:29
本文介绍了Laravel 4:重定向到给定的网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 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');

推荐答案

是的

use IlluminateSupportFacadesRedirect;

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:重定向到给定的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆