**CI中自动类加载的用法总结
总结:
哪一个类中用到某一个类,就在构造函数中加载这个类,比如m_attach,C_Feed类中有用到,那么就在构造函数中加载
控制器:
class C_Feed extends CI_Controller {
public function __construct()
{
parent::__construct();
//加载模型类
$this->load->model('m_feed');
$this->load->model('m_attach');
}
模型类:
class M_Feed extends CI_Model {
public function __construct()
{
//加载数据库配置
$this->load->database();
$this->load->model('m_attach');
}
如何联系我:【我的公司】www.xinzhenkj.com(信真科技)【技术咨询】www.laohuzx.com 【QQ】3396726884
图书购买京东链接***微信小程序商城开发实战*** | ***新媒体营销精华:精准定位+爆款打造+匠心运营+内容变现***

浙公网安备 33010602011771号