JAVA、PHP、前端、APP、网站开发 - 开发技术学习

开发技术学习 » 编程开发 » codeigniter,Unable to locate the model you have specified:

codeigniter,Unable to locate the model you have specified:

此文被围观7436日期: 2014-05-14 分类 : 编程开发  标签:  ·····

今天在写一个codeigniter程序的时候出现了 

Unable to locate the model you have specified:*_model  这个问题

对CI不是很熟悉,呵呵!

解决方法:

model文件名应该是login_model.php

class Login_model extends CI_Model{
    
    public function __construct(){
        parent::__construct();
        $this->load->database();
    }
}
class Login extends CI_Controller{

    public function __construct(){
        parent::__construct();
        $this->load->model('login_model');
    }
    
}

修改所有的model: 

1. 文件名全部小写,不能出现大小写混排 (all filenames need to be lowercase)

2. class model_name , model_name 只有第一个字母是大写,其余一律小写


站点声明:部分内容源自互联网,为传播信息之用,如有侵权,请联系我们删除。

© Copyright 2011-2024 www.kfju.com. All Rights Reserved.
超级字帖 版权所有。蜀ICP备12031064号