tp5中,模板、控制器、js的url跳转方法

$this->redirect('/Supperman/outerMan');
$this->display('Supperman:outerMan');这两者都只是在当前页面打开新的页面
然后又试了一下
header('Location:'.U('/Supperman/outerMan').'',false);
还是不能满足效果。使用js
echo "<script language='javascript' type='text/javascript'>";
echo "window.location.href='".U('/Supperman/outerMan')."'";
echo "</script>";
仍然达不到效果。
使用:
echo "<script language='javascript' type='text/javascript'>";
echo "window.open='".U('/Supperman/outerMan')."'";
echo "</script>";

猜你喜欢

转载自www.cnblogs.com/cl94/p/9026956.html