codeigniter 笔记六
来源:互联网 发布:javascript not 编辑:程序博客网 时间:2024/05/22 16:03
继续 codeigniter.php
line 248 include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().'.php');
这句话就是加载跟当前类同名的控制器
line 262 $class = $RTR->fetch_class();
line 263 $method = $RTR->fetch_method();
路由加载默认的类和方法名(默认是index)
line 300 - line340
if (method_exists($CI, '_remap')){$CI->_remap($method, array_slice($URI->rsegments, 2));}else{// is_callable() returns TRUE on some versions of PHP 5 for private and protected// methods, so we'll use this workaround for consistent behaviorif ( ! in_array(strtolower($method), array_map('strtolower', get_class_methods($CI)))){// Check and see if we are using a 404 override and use it.if ( ! empty($RTR->routes['404_override'])){$x = explode('/', $RTR->routes['404_override']);$class = $x[0];$method = (isset($x[1]) ? $x[1] : 'index');if ( ! class_exists($class)){if ( ! file_exists(APPPATH.'controllers/'.$class.'.php')){show_404("{$class}/{$method}");}include_once(APPPATH.'controllers/'.$class.'.php');unset($CI);$CI = new $class();}}else{show_404("{$class}/{$method}");}}// Call the requested method.// Any URI segments present (besides the class/function) will be passed to the method for conveniencecall_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2));}这段是调用控制器中的方法。
get_class_methods 获取类中的方法
call_user_func_array 调用指定的方法
get_object_vars 对象 转换成数组
if ($EXT->_call_hook('display_override') === FALSE){$OUT->_display();}将结果输出到浏览器
if (class_exists('CI_DB') AND isset($CI->db)){$CI->db->close();}如果数据库打开 关闭数据库连接
codeigniter.php 结束了,一个程序也就运行完了
- codeigniter 笔记六
- CodeIgniter笔记
- CodeIgniter笔记
- codeigniter 笔记一
- codeigniter 笔记二
- codeigniter 笔记三
- codeigniter 笔记四
- codeigniter 笔记五
- codeigniter 笔记七
- CodeIgniter 学习笔记
- CodeIgniter学习笔记总汇
- codeigniter笔记(2)
- CodeIgniter笔记4
- CodeIgniter笔记3
- CodeIgniter笔记1
- CodeIgniter学习笔记
- CodeIgniter笔记1
- CodeIgniter笔记1
- 创建flex的web工程的方法(总结)
- 草稿
- Xtools工具箱下载地址
- dup和dup2
- android基础
- codeigniter 笔记六
- Excel 导入 Sql Server出错——“文本被截断,或者一个或多个字符在目标代码页中没有匹配项”错误的解决
- corefile配置
- 急急急急急急急急急急急急
- Excel从另一个Excel文件中用户自定义区域(UsedRange)拷贝数据和行高、列宽
- 谁能证伪?
- 解决FCKeditor在线文本编辑器自动过滤HTML标签的方法
- LINUX_vi编辑器
- 淘宝搜索:定向抓取网页技术漫谈