//自动加载文件
public static function _autoload($className){
switch ($className){
//自动model类
case substr($className,-5)=='Model':
$path= MODEL.'/'.$className.'.php';
if(is_file($path)) include $path;
break;
//自动加载控制器
case substr($className,-3)=='Crl':
$path= CONTROLLER.'/'.$className.'.php';
if(is_file($path)) include $path;
break;
//自动加载基类
case substr($className,-4)=='Base':
$path= KJ_CORE.'/base/'.$className.'.php';
if(is_file($path)) include $path;
break;
default :
break;
}
}
3、model可定义table,ModelBase.php
public function __construct($table=null){
if($table){
$this->table=$table;
}
if(!$this->table){
die("no table" );
}
$this->_connect();
$this->_opt();
}
4、创建model文件,testModel.php
<?php
class testModel extends ModelBase{
public $table='test';
public function findId($id)
{
return $this->where('id='.$id)->find();
}
}
5、调用model,indexCrl.php
<?php
class indexCrl{
public function index(){
$model=new testModel();
$data=$model->select();
var_dump($data);
$data2=$model->findId(1);
var_dump($data2);
}
}
★ 知识点
二、知识点
Local型索引有如下优点
1.Only one index partition must be rebuilt when a maintenance operation other than SPLIT PARTITION or ADD PARTITION is performed on an underlying table partition.
2.The duration of a partition maintenance opera…
压缩之前,虚拟机占用磁盘空间 虚拟机必须已经安装vmware-tool,运行如下命令,参看磁盘的挂载点 sudo /usr/bin/vmware-toolbox-cmd disk list $sudo /usr/bin/vmware-toolbox-cmd disk list
[sudo] password for lkmao:
Shrink disk is disab…
文章目录 🍰有几个原因可以解释为什么要选择 RabbitMQ:🥩mq之间的对比🌽RabbitMQ vs Apache Kafka🌽RabbitMQ vs ActiveMQ🌽RabbitMQ vs RocketMQ🌽RabbitMQ vs Redis 🥩linux docke…
1.创建三要素 场景 // 创建场景 const scene new THREE.Scene() 相机 // 创建透视相机 const camera new THREE.PerspectiveCamera(a,b,c,d) // 参数含义 // a:相机可视垂直角度;b:相机可视长宽比;c:近端距离;d:远端…