0
當我試圖擴展CI_Model時,我對codeigniter和MVC很新,我有一個致命錯誤。 我做它像例子可以點是我錯了:codeigniter錯誤當我擴展CI_Model
class Site extends CI_Controller {
public function index(){
echo "hi internet <br>";
$this->hello();
$this->addStuff();
}
public function hello(){
echo " H E L L O <br>";
}
public function addStuff(){
echo "math <br>";
$this->load->model("math");
echo $this->Math->add(3,8);
}
}
class Math extends CI_Model {
public function add($num1,$num2){
return $num1+$num2;
}
public function sub($num1,$num2){
return $num1+$num2;
}
}
我的錯誤是:
Fatal error: Class 'application\models\CI_Model' not found
in C:\projects \CodeIgniter\application\models\Math.php on line 12 line 12 is class
Math extends CI_Model line
可能重複:類'CI \ _Model'not found](http://stackoverflow.com/questions/12503783/fatal-error-class-ci-model-not-found) –
我不會延長模型 – user3041833
class Math延長CI_Model – user3041833