找不到“User_model_new”类!!!可能是什么原因?

时间:2013-09-16 06:46:03

标签: php codeigniter model codeigniter-2

<?php
 // my user_model_new.php file in application/model folder
 class User_model_new extends CI_Model{
    private $random_property;
    function __construct()
    {
        parent::__construct();
    }
    protected get_random_property()
    {
        return $this->random_property;
    }
 }
 // my article_model.php file in application/model folder
 class Article_model extends User_model_new{
     function show_random()
     {
         $this->get_random_property();
     }  

 }

但现在如果我运行代码codeIgniter显示此错误“class User_model_new”未找到。这有什么不对?帮助我因为它而陷入困境。

1 个答案:

答案 0 :(得分:1)

<强>替换

 class Article_model extends User_model{

。通过

 class Article_model extends User_model_new{