<?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”未找到。这有什么不对?帮助我因为它而陷入困境。
答案 0 :(得分:1)
<强>替换强>
class Article_model extends User_model{
。通过强>
class Article_model extends User_model_new{