无法找到您指定的模型

编程入门 行业动态 更新时间:2024-10-04 07:27:24
本文介绍了无法找到您指定的模型 - CodeIgniter Issue的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我无法找到模型错误。

$this->load->model('1/Gift_model');

我的模型文件名是 gift_model.php ,在/ models / 1 / 。

My model file name is gift_model.php within /models/1/.

我用以下方式声明模型。

I declare the model the following way.

class Gift_model extends CI_Model {

根据CodeIgniter的文档,我以正确的方式做。有什么建议么?

According to CodeIgniter's documentation I'm doing it the correct way. Any suggestions? I have 5 other models named exactly the same way and they're all loading fine.

推荐答案

  • 设置模型类名大写 My_model
  • 设置模型php文件名 my_model
  • 使用小写(文件名)加载模型 $ this-> load-> model('my_model');
  • Make the model class name Uppercase My_model
  • Make the model php file name Lowercase my_model
  • Load the model using Lowercase (file name) $this->load->model('my_model');
  • 更多推荐

    无法找到您指定的模型

    本文发布于:2023-11-02 06:39:07,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1551640.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:到您   模型

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!