ThinkPHP redirect 页面重定向使用详解与实例
生活随笔
收集整理的這篇文章主要介紹了
ThinkPHP redirect 页面重定向使用详解与实例
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
ThinkPHP redirect 方法
ThinkPHP redirect 方法可以實(shí)現(xiàn)頁(yè)面的重定向(跳轉(zhuǎn))功能。redirect 方法語(yǔ)法如下:
$this->redirect(string?url,?array?params,?int?delay,?string?msg)
參數(shù)說(shuō)明:
url 必須,重定向的 URL 表達(dá)式。
params 可選,其它URL參數(shù)。
delay 可選, 重定向延時(shí),單位為秒。
msg 可選,重定向提示信息。
ThinkPHP redirect 實(shí)例
在 Index 模塊 index 方法中,重定向到本模塊的 select 操作:
class?IndexAction?extends?Action{? public?function?index(){? $this->redirect('select',?array('status'=>1),?3,?'頁(yè)面跳轉(zhuǎn)中~');? }? }
ThinkPHP redirect 方法可以實(shí)現(xiàn)頁(yè)面的重定向(跳轉(zhuǎn))功能。redirect 方法語(yǔ)法如下:
參數(shù)說(shuō)明:
url 必須,重定向的 URL 表達(dá)式。
params 可選,其它URL參數(shù)。
delay 可選, 重定向延時(shí),單位為秒。
msg 可選,重定向提示信息。
ThinkPHP redirect 實(shí)例
在 Index 模塊 index 方法中,重定向到本模塊的 select 操作:
總結(jié)
以上是生活随笔為你收集整理的ThinkPHP redirect 页面重定向使用详解与实例的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ubuntu nginx配置负载均衡篇(
- 下一篇: php-protobuf扩展和代码生成工