用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2720|回复: 2
收起左侧

[已解决] 求解ci源码中的一段代码的应用场景

[复制链接]
发表于 2012-4-24 21:01:59 | 显示全部楼层 |阅读模式
/*
* ------------------------------------------------------
*        Is there a valid cache file?  If so, we're done...
* ------------------------------------------------------
*/
        if ($EXT->_call_hook('cache_override') === FALSE)
        {
                if ($OUT->_display_cache($CFG, $URI) == TRUE)
                {
                        exit;
                }
        }

在system/core/Codeigniter.php 中的这段代码。

虽然知道作用是什么,但是它的应用场景是什么呢?

发表于 2012-4-25 19:04:01 | 显示全部楼层
钩子 http://codeigniter.org.cn/user_guide/general/hooks.html
就是用来改变系统行为的,比如你想在 CI 加载控制器之前做点什么事情,就用这个。
 楼主| 发表于 2012-4-26 17:50:28 | 显示全部楼层
Hex 发表于 2012-4-25 19:04
钩子 http://codeigniter.org.cn/user_guide/general/hooks.html
就是用来改变系统行为的,比如你想在 CI  ...

了然,多谢大哥

本版积分规则