- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我知道这里很多人都遇到过这个问题,我也遇到过很多次并解决了。但这次我尝试了我所知道的一切以及我在 StackOverFlow 上找到的一切,但没有任何效果..
我的情况:
我在这样的文件夹中有一个名为 ClientsManagement.php
的模型:
application/models/Management/ClientsManagement.php
我试过:
$this->load->model('Management/ClientsManagement');
但是我收到了这个错误:
无法找到您指定的模型:ClientsManagement
注意:它在 windows 上工作,但我在转移到 linux (debian) 时遇到了这个问题..
注释:
我尊重大小写(linux 区分大小写)
我的重写模式运行良好。
它在 WINDOWS 上运行!
最佳答案
我认为最好做一些事情,比如在类和文件名的末尾或开头有 word model 这样 codeigniter 就可以确保它是模型而不是其他任何东西.
文件夹名称: management => Clients_management_model.php
<?php
class Clients_management_model extends CI_Model {
public function some_function() {
}
}
然后 Controller
public function __construct() {
parent::__construct();
$this->load->model('management/clients_management_model');
}
public function index() {
$data['something'] = $this->clients_management_model->some_function();
}
关于php - 代码点火器 : Unable to locate a model?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33292483/
我正在使用 Codeigniter,问题是我的 Controller 中有重复很多的特定代码,我需要将这段代码放在一个地方,然后在 Controller 中调用它。 例子: public funct
我真的很想知道我该怎么做,我有 3 个页面具有指向 1 个页面的相同链接,现在我想要做的是拥有 1 个足够智能的按钮来获取使用了 3 个页面中的哪一个转到该页面并使用它作为返回上一页的链接。 如果有人
我需要从 site_url() 返回值中删除 index.php我不希望搜索引擎缓存我的 URL 包含 index.php。 我通过设置 .htaccess 文件从 url 中删除了 index.ph
我是一名优秀的程序员,十分优秀!