thinkphp跳转和重定向
来源:互联网 发布:mysql书籍推荐 知乎 编辑:程序博客网 时间:2024/05/29 13:56
$User = M('User');
$result = $User->add($data);
if(){
//第一个参数表示提示信息,第二个参数表示跳转地址,第三个参数表示跳转时间,单位为秒
$this->success('新增成功','User/list',3);
}else{
//error方法默认跳转地址是javascript:history.back(-1);
//默认等待时间success是1秒,error是3秒
$this->error('新增失败');
}
Controller类的redirect方法可以实现页面的重定向功能
//重定向到New模块的Category操作,停留5秒后,第二个参数是需要传递的参数
$this->redirect('New/category',array('cate_id'=>2),5,'页面跳转中');
redirect函数重定向
redirect('/New/category/cate_id/2',5,'页面跳转中');
注意:仅仅是想要重定向一个指定的URL地址,而不是到某个模块的操作方法,可以直接使用redirect函数
0 0
- thinkphp跳转和重定向
- thinkphp之URL,跳转和重定向
- ThinkPHP 页面跳转和重定向
- Thinkphp 控制器->跳转和重定向
- 重定向和跳转
- 重定向和跳转
- ThinkPHP 手册摘录之跳转、重定向
- thinkPHP跳转方法及重定向
- 页面跳转和重定向
- ThinkPHP笔记------重定向
- thinkphp页面重定向
- servlet jsp 重定向 和服务器跳转
- 重定向和跳转的区别
- 跳转和重定向的区别
- servlet中的跳转和重定向
- Servlet中的跳转和重定向
- jquery中的跳转和重定向
- forward内部跳转 和redirect重定向跳转的区别
- thinkphp判断请求类型
- Js遍历键值对形式对象或Map形式
- 欢迎使用CSDN-markdown编辑器
- JS原型链问题
- LVS:三种负载均衡方式比较
- thinkphp跳转和重定向
- PHP批量去除文件头部Bom信息
- RAMAnimatedTabBarController -swift kit
- visual studio运行时库MT、MTd、MD、MDd的研究
- ueditor编辑器使用
- The method getTextContent() is undefined for the type Element
- 08-1. 求一批整数中出现最多的个位数字(20)
- listview添加头部view问题,数组越界问题
- thinkphp的I方法