现在的位置: 首页 > 综合 > 正文

ThinkPHP redirect 页面重定向使用详解与实例

2017年12月11日 ⁄ 综合 ⁄ 共 378字 ⁄ 字号 评论关闭

ThinkPHP redirect 方法

ThinkPHP redirect 方法可以实现页面的重定向(跳转)功能。redirect 方法语法如下:


  1. $this->redirect(string url, array params, int delay, string msg)


参数说明:
url 必须,重定向的 URL 表达式。
params 可选,其它URL参数。
delay 可选, 重定向延时,单位为秒。
msg 可选,重定向提示信息。
ThinkPHP redirect 实例

在 Index 模块 index 方法中,重定向到本模块的 select 操作:


  1. class IndexAction extends Action{ 
  2. public function index(){ 
  3. $this->redirect('select'array('status'=>1), 3, '页面跳转中~'); 
  4. }

抱歉!评论已关闭.