亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

ThinkPHP中redirect用法分析

 更新時(shí)間:2014年12月05日 11:29:30   投稿:shichen2014  
這篇文章主要介紹了ThinkPHP中redirect用法,實(shí)例分析了redirect重定向的各種常見(jiàn)操作技巧,具有一定的實(shí)用價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了ThinkPHP中redirect用法。分享給大家供大家參考。具體分析如下:

redirect 重定向的通用語(yǔ)法為:redirect(url,params=array(),delay=0,msg=''),假設(shè)當(dāng)前為默認(rèn) HOME分組 Aritcle模塊 insert操作,一些例子如下:

復(fù)制代碼 代碼如下:
// 跳轉(zhuǎn)到 edit 操作  
$this->redirect('edit');  

// 跳轉(zhuǎn)到 UserAction下的edit 操作  
$this->redirect('User/edit');  

// 跳轉(zhuǎn)到 Admin分組默認(rèn)模塊默認(rèn)操作 
$this->redirect('Admin/'); 

// 跳轉(zhuǎn)到 Admin分組Index模塊view操作 
$this->redirect('Admin-Index/view');  

// 跳轉(zhuǎn)到 Admin分組Index模塊view操作,uid參數(shù)為1,延遲3秒跳轉(zhuǎn) 
$this->redirect('Admin-Index/view', array('uid'=>1), 3,'頁(yè)面跳轉(zhuǎn)中~')  

// 跳轉(zhuǎn)到 其他OtherApp項(xiàng)目(非分組)的Admin項(xiàng)目分組User模塊view操作  
$this->redirect('OtherApp://Admin-User/view');

同項(xiàng)目分組中的URL訪問(wèn)一樣,redirect 中跨分組跳轉(zhuǎn)只是多了一個(gè)分組項(xiàng)目名稱的概念.

提示:可以在 redirect 中使用路由,redirect 方法的參數(shù)用法和 U函數(shù) 的用法一致.可參考 U函數(shù) 生成URL地址相關(guān)部分內(nèi)容.

更多關(guān)于thinkPHP相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《ThinkPHP入門(mén)教程》、《thinkPHP模板操作技巧總結(jié)》、《ThinkPHP常用方法總結(jié)》、《smarty模板入門(mén)基礎(chǔ)教程》及《PHP模板技術(shù)總結(jié)》。

希望本文所述對(duì)大家基于ThinkPHP框架的PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論