xiao6233305 发表于 2011-8-18 14:12:36

哪位帮小弟解决下问题啊

class Blog extends CI_Controller {
function bloog()
{
      $this->load->model('Blog');
      $this->Blog->test();
}

上面那个是控制器的类
class Blogmodel extends CI_Model {
    function __construct()
    {
      parent::__construct();
    }
    function test()
    {
            echo 'it is test';
    }这个是模型类
但是我的程序怎么总是报错啊~~调用这个模型类中任何一个方法都会说没有定义该方法啊(Fatal error: Call to undefined method Blog::test() in D:\wamp\www\CodeIgniter\application\controllers\blog.php on line 46

zhouli520 发表于 2011-8-18 14:29:33

$this->load->model('Blog');
->$this->load->model('Blogmodel');

xiao6233305 发表于 2011-8-18 15:18:55

谢谢啊~~这个弄了我差不多一天~~
页: [1]
查看完整版本: 哪位帮小弟解决下问题啊