简体   繁体   English

从Codeigniter中的库中加载模型

[英]Loading Models From In Libraries In Codeigniter

In my systems libraries folder I have a custom user library file. 在我的系统库文件夹中,我有一个自定义用户库文件。 I put it in there because I have multiple codeigniter installs. 我把它放在那里,因为我安装了多个codeigniter。

I can not seem to call my admin directories user model using fcpath. 我似乎无法使用fcpath调用我的管理目录用户模型。

$this->CI->load->model(dirname(FCPATH) . '/admin/application/modules/backend/models/user/user_model.php');

Any suggestions. 有什么建议么。

Just been more looking around Google and able to load it now all working now I hope. 我希望能更多地环顾Google并能够立即加载它。 Just going to test it. 只是要测试一下。

$file = dirname(FCPATH) . '/admin/application/modules/backend/models/user/user_model.php';
$file = dirname(FCPATH) . '/install/application/modules/setup/models/install_model.php'; // Only For Install Once

if(file_exists($file)) {
return true;
} else {
echo "Can't find file located in: " . $file;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM