课程/PHP/后端开发
从零开始打造自己的PHP框架
-
-
weixin_慕斯卡7068374
2019-10-02
自动加载方法

-
截图
0赞 · 0采集
-
-
weixin_慕斯卡7068374
2019-10-02
动加载类00

-
截图
0赞 · 0采集
-
-
weixin_慕斯卡7068374
2019-10-02
自动加载类
-
0赞 · 0采集
-
-
mtr2014
2019-09-25
自动加载~~
-
截图
0赞 · 0采集
-
-
童莉莉
2018-03-20
- spl 全称Standard PHP Library
-
截图
0赞 · 0采集
-
-
童莉莉
2018-03-20
- spl_autoload_register()
当我们new一个类时,类不存在会出发这个方法
-
截图
0赞 · 0采集
-
-
非慕粉001
2017-06-14
- 当写到 此次是 需要在 index.php 中引入
//引入被执行文件
include "CORE".'\lib\route.php'; 这个文件 否则一直报错误
-
0赞 · 0采集
-
-
慕妹2418420
2017-05-11
- good good
-
截图
0赞 · 0采集
-
-
慕粉1725412496
2017-03-09
- sql_autoload_register();当我们new的类不存在的时候,就会触发该方法。
自动加载类库
new、core、route();
-
0赞 · 0采集
-
-
慕粉36
2017-01-14
- 我怎么就错误
-
截图
0赞 · 0采集
-
-
cmojo
2016-11-30
- 老师讲蛮好的...我自己琢磨了一下...这样才是老师想说的把
<?php
namespace core;
class nj
{
static public $classMap = array();
static public function run(){
new \core\lib\route();
}
static public function load($class){
$class = str_replace('\\','/',$class);
if(isset(self::$classMap[$class])){
return true;
}else{
$path = NJ.'/'.$class.'.php';
if(is_file($path)){
include $path;
self::$classMap[$class] = $class;
}else{
return false;
}
}
}
}
-
截图
1赞 · 2采集
-
-
DB_ruan
2016-10-23
- 自动加载类核心代码:
如果已经引入,就不再重复引入。
如果没有,就先转化命名空间位文件路径。
-
截图
0赞 · 3采集
-
-
mtr2014
2016-09-22
- 入口文件basic
-
截图
0赞 · 0采集
-
-
慕粉1473048893
2016-09-13
- 定义系统常量
启动系统常量
-
截图
0赞 · 0采集
-
-
慕粉3216583
2016-09-11
- 自动加载类
-
截图
0赞 · 2采集