首页 > 其他 > 详细

Redirect

时间:2016-07-05 11:47:36      阅读:225      评论:0      收藏:0      [点我收藏+]

Redirect

To use this Class, add the following to the top of the file.

use Redirect;

Redirect::to($path, $status = 302, $headers = array(), $secure = null)

Creates a new redirect response to the given path.

// Create a Redirect Response to a location within the application
return Redirect::to(‘user/profile‘);

// Create a Redirect Response with a 301 status code
return Redirect::to(‘user/profile‘, 301);

// Create a Redirect Response and flash to the Session
return Redirect::to(‘profile‘)->with(‘message‘, ‘Welcome Back!‘);

Redirect::home($status = 302)

Creates a new redirect response to the "home" route.

return Redirect::home();

Redirect::back($status = 302, $headers = array())

Create a new redirect response to the previous location.

return Redirect::back();

Redirect::refresh($status = 302, $headers = array())

Create a new redirect response to the current URI.

return Redirect::refresh();

Redirect::guest($path, $status = 302, $headers = array(), $secure = null)

Create a new redirect response, while putting the current URL in the session.

return Redirect::guest(‘user/profile‘);

Redirect::away($path, $status = 302, $headers = array())

Create a new redirect response to an external URL (no validation).

return Redirect::away(‘http://www.google.com‘);

Redirect::secure($path, $status = 302, $headers = array())

Create a new redirect response to the given HTTPS path.

return Redirect::secure(‘user/profile‘);

Redirect

原文:http://www.cnblogs.com/chunguang/p/5643013.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!