这篇文章主要介绍了ThinkPHP中redirect用法,实例分析了redirect重定向的各种常见操作技巧,具有一定的实用价值,需要的朋友可以参考下
本文实例讲述了ThinkPHP中redirect用法。分享给大家供大家参考。具体分析如下:
redirect 重定向的通用语法为:redirect(url,params=array(),delay=0,msg=”),假设当前为默认 HOME分组 Aritcle模块 insert操作,一些例子如下:
代码如下:
// 跳转到 edit 操作
$t来源[email protected]搞@^&代*@码网his->redirect(‘edit’);
$t来源[email protected]搞@^&代*@码网his->redirect(‘edit’);
// 跳转到 UserAction下的edit 操作
$this->redirect(‘User/edit’);
// 跳转到 Admin分组默认模块默认操作
$this->redirect(‘Admin/’);
// 跳转到 Admin分组Index模块view操作
$this->redirect(‘Admin-Index/view’);
// 跳转到 Admin分组Index模块view操作,uid参数为1,延迟3秒跳转
$this->redirect(‘Admin-Index/view’, array(‘uid’=>1), 3,’页面跳转中~’)
// 跳转到 其他OtherApp项目(非分组)的Admin项目分组User模块view操作
$this->redirect(‘OtherApp://Admin-User/view’);
以上就是ThinkPHP中redirect用法分析的详细内容,更多请关注gaodaima搞代码网其它相关文章!