3.2.2 - 普通 - 未处理
success跳转按官网文档($this->success('新增成功', 'User/list');)所说方法,在一定条件下貌似会出现BUG,用U方法也许更完美。编辑页面:
http://127.0.0.1/youhuiquan/index.php/Admin/Index/bizedit/id/1
本意是提交成功后跳转到
http://127.0.0.1/youhuiquan/index.php/Admin/Index/index
于是
1、这么写:
$this->success('修改成功!', 'Index/index');
跳到了
http://127.0.0.1/youhuiquan/index.php/Admin/Index/bizedit/id/Index/index
2、这么写:
$this->success('修改成功!', '/Index/index');
跳到了
http://127.0.0.1/Index/bizlist
3、这么写:
$this->success('修改成功!', 'Admin/Index/index');
跳到了
http://127.0.0.1/youhuiquan/index.php/Admin/Index/bizedit/id/Admin/Index/index
4、这么写:
$this->success('修改成功!', '/Admin/Index/index');
跳到了
http://127.0.0.1/Admin/Index/bizlist
5、这么写:
$this->success('修改成功!', 'index');
跳到了
http://127.0.0.1/youhuiquan/index.php/Admin/Index/bizedit/id/index
所以我该怎么写?
官方文档http://document.thinkphp.cn/manual_3_2.html#page_jump_redirect
上给的方法是我上面试的1和2,但都不行啊。。
解决办法是用U函数:$this->success('修改成功!', U('index') );
