thinkphp的常用页面跳转语句的用法

注意四点:

1.Action::error (行 338)
操作错误跳转的快捷方法
: public
void error (string $errorMsg, [Boolean $ajax = false])
string $errorMsg: 错误信息
: 是否为Ajax方式
::success (行 360)
操作成功跳转的快捷方法
: public
void success (string $message, [Boolean $ajax = false])
string $message: 提示信息
: 是否为Ajax方式
::redirect (行 473)
Action跳转(URL重定向) 支持指定模块和延时跳转
: public
void redirect (string $action, [string $module = MODULE_NAME], [string $route = ''], [string $app = APP_NAME], [array $params = array()], [integer $delay = 0], [string $msg = ''])
string $action: 要跳转的Action
: 要跳转的Module 默认为当前模块
: 要跳转的App 默认为当前项目
: 路由名
array $params: 其它URL参数
: 延时跳转的时间 单位为秒
: 跳转提示信息
::forward (行 431)
执行某个Action操作(隐含跳转) 支持指定模块和延时执行
: public
void forward ([mixed $action = '_dispatch_jump'], [string $module = MODULE_NAME], [string $app = APP_NAME], [boolean $exit = false], [integer $delay = 0])
mixed $action: 要跳转的Action 默认为_dispatch_jump
: 要跳转的Module 默认为当前模块
: 要跳转的App 默认为当前项目
: 是否继续执行
: 延时跳转的时间 单位为秒
(string $url, [integer $time = 0], [string $msg = ''])      access         Boolean $ajax
2.Action      access         Boolean $ajax
3.Action      access         string $module   string $app   string $route      integer $delay   string $msg   
4.Action      access         string $module   string $app   boolean $exit   integer $delay   
5.redirect
    URL重定向
    string $url  要定向的URL地址
    integer $time  定向的延迟时间,单位为秒
    string $msg  提示信息
    void redirect1-4 是action的方法。也就是说在action类可以用$this->error()等就可以调用了。5 是个函数,在任何地方都可以调用。调用Action::error()与Action::success()是需要在Tpl/Default/Public目录下添加一个Success.html文件才能跳转。否则提示模板找不到。Action::redirect() 和函数redirect()的区别在于Action::redirect()的参数是操作名,模块名,项目名。而函数redirect()的方法是完整的URL。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值