php - 找不到型号
问题描述
无法找到您指定的模型:Empresa_model
文件名:/opt/lampp/htdocs/actzap_CI/system/core/Loader.php
我已经多次编写此代码,但问题仍然存在,有人可以帮忙吗?对不起,我的英语不好
模型:
class Empresa_model extends CI_Model {
//...
function __construct(){
parent::__construct();
}
public function listaEmpresas(){
return $this->db->get("empresa")->result_array();
}
//...
}
控制器:
class Empresa_controller extends CI_Controller
public function index()
{
$this->load->model('empresa_model');
$lista = $this->empresa_model->listaEmpresas();
$dados = array("empresa" => $lista);
$this->template->show('empresa', $dados);
}
//...
}
完全错误:
An uncaught Exception was encountered
Type: RuntimeException
Message: Unable to locate the model you have specified: Empresa_model
Filename: /opt/lampp/htdocs/actzap_CI/system/core/Loader.php
Line Number: 348
Backtrace:
File: /opt/lampp/htdocs/actzap_CI/application/controllers/Empresa_controller.php
Line: 9
Function: model
File: /opt/lampp/htdocs/actzap_CI/index.php
Line: 315
Function: require_once
解决方案
推荐阅读
- docker - 如何使用 3 个不同的容器在 docker 上集群 rethinkdb 数据库?
- javascript - 如何在 7 天前获得凌晨 12 点?
- android - 动态可扩展 Recyclerview 列表失败
- python - 在数据框列中搜索“*”字符串
- azure - 如何从 Azure 导出或保留长达 5 年的日志?
- apache-spark - Spark 3结构化流在Kafka源中使用maxOffsetsPerTrigger和Trigger.Once
- java - 如何在 JFreeChart 中获得易断轴?
- java - Spring Boot默认属性值中的花括号
- python-3.x - [已解决]如何对 bot 在 discord.py 中发送的消息添加反应?
- python - 绘制二维随机游走的均方位移作为 δt 的函数