您现在的位置是:首页 > PHP技术PHP技术
Thinkphp3.1.3中的redirect详解
2019-04-27【PHP技术】2923 人已围观
简介 页面跳转是php编程中常用的方法,今天说说thinkphp3.1.3中的redirect.tp跳转有success和error这二个参...
页面跳转是php编程中常用的方法,今天说说thinkphp3.1.3中的redirect.
tp跳转有success和error这二个参数有页面提示. 有时需要静默跳转redirct
redirect 重定向的通用语法为:redirect(url,params=array(),delay=0,msg=''),假设当前为默认 HOME分组 Aritcle模块 insert操作,一些例子如下:
// 跳转到 edit 操作
$this->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');关注宁波网站建设博客,更多精彩分享,敬请期待!
Tags:
很赞哦! ()
下一篇:百度浏览器宣布不在更新
相关文章
随机图文
PHP单例模式我的理解
PHP现在版本越来越新的了,功能也是强大许多,貌似语法习惯也开始参考C java之类,有命名空间等等。今天小编在学习Thinkphp5.1....
Thinkphp3.1.3验证码字符居中显示
tp3中的验证码默认是按图片要求宽度加5个象素为起始的. 如果验证码设置非默认宽度就会造成字符不居中.居中解决办法修改\ThinkPHP...
Sublime Text添加插入带当前代码段说明
sublime是小编目前使用当中的一款php程序编辑器,功能非常的强大,今天推荐给各位.下面是如何在代码段内快捷插入常用说明.非常实用哦 ...
thinkphp imagettftext(): Could not find/open font验证码无法显示报错
thinkphp imagettftext(): Could not find/open font tp5.1验证码无法显示.打开debu...




微信收款码
支付宝收款码